Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 22nd, 2006, 3:08 AM   #1
myName
Programmer
 
Join Date: Oct 2005
Posts: 48
Rep Power: 0 myName is on a distinguished road
socket tcp/ip

I'm new in the c++ tcp/ip socket programming.

Is there any website tutorial, or simple example for beginner?

I've found some, but all are not understand.

And i've try the example from msdn also...
[PHP]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/complete_server_code.asp[/PHP]

for both client and server example.

but there 10 error in for client, and 13 error for server.
eg.
[PHP]server.obj : error LNK2001: unresolved external symbol __imp__send@16[/PHP]

I just need to create a client to connect with a server.
Client need to send a string message to server.

How to do it?

How to start?

Please give me some guide... thanks
myName is offline   Reply With Quote
Old Feb 22nd, 2006, 3:16 AM   #2
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
If you'd cared to search (the forums or even google), you'd find Beej.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Feb 22nd, 2006, 5:32 AM   #3
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 261
Rep Power: 4 Cache is on a distinguished road
Hmm, why do I get the idea that you just copy/pasted the client/server code without actually reading the guide?

Possibly because if you had read the whole thing, you would know to link WS2_32.lib into your project?
Cache is offline   Reply With Quote
Old Feb 22nd, 2006, 7:22 AM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I suggest Beej also. Google it.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Feb 22nd, 2006, 9:41 AM   #5
myName
Programmer
 
Join Date: Oct 2005
Posts: 48
Rep Power: 0 myName is on a distinguished road
:p i'm hope to get thing done as fast as i can so i din't do much research,
just copy and paste the example in msdn.

thx ppl... i know what is the couse of the error...

i include:

#pragma comment(lib, "wsock32.lib")

in the client.cpp and server.cpp.

this solve my problem.

Now i get the connection... still left some other logic to do..
myName is offline   Reply With Quote
Old Feb 22nd, 2006, 9:53 AM   #6
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 261
Rep Power: 4 Cache is on a distinguished road
For the MSDN example you should be linking to: WS2_32.lib
which is the winsock 2 library.
Cache is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC