Advertisement

Using send and recv (winsock)

Started by April 28, 2000 11:52 PM
2 comments, last by Ratman 24 years, 10 months ago
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
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.
Advertisement
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.
--
Richard Rice
GameSpy Industries
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.



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

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

This topic is closed to new replies.

Advertisement