🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Using send and recv (winsock)

Started by
2 comments, last by Ratman 24 years, 1 month 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
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.
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