• Advertisement

Archived

This topic is now archived and is closed to further replies.

Using send and recv (winsock)

This topic is 6475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

could someone give me and example of using send and recv with winsock? Assume I have a socket connected and everything else set. I''d just like to see how to send a random number, and/or a string. Thanks for any help. Dave Ratti

Share this post


Link to post
Share on other sites
Advertisement
in both borland c++ and visual c++, there are examples
of server/client apps that use winsock for sending and
receiving. They''re called chatsrvr and chatter, they
contain the basics.

Share this post


Link to post
Share on other sites
You can also find these examples on the web at...

http://msdn.microsoft.com/library/default.asp?URL=/library/devprods/vs6/visualc/vcsample/_sample_mfc_chatsrvr.htm


Concider using select() or ioctlsocket() to aid you in setting timeouts for send and recv.

Share this post


Link to post
Share on other sites
I got my first taste of sockets by making a Battle.net bot You can get the sample code (including working sockets) from www.battle.net. Follow the download links, then look for greetbot.

--------------------


You are not a real programmer until you end all your sentences with semicolons;

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

Share this post


Link to post
Share on other sites

  • Advertisement