Jump to content
  • Advertisement


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



This topic is 5820 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

Ive finally decided to try and figure out how to use winsock. Working off stuff I''ve found on the internet I''ve figured out how to make a client/server app. My problem is that if the order of communication is not predetermined it doesn''t seem to work. If the server is blocking the socket waiting to recv() it cannot send(). Do I need to use two ports-one to send data in each direction??? I presume this is a really simple problem and Im being blind Thanks, Joe

Share this post

Link to post
Share on other sites
Look into a function called "select (...)"

This function will tell if you have any data to be read in a
selected port. If so, then use "rec ( ... )" to read the port.
If there isn''t anything then don''t use the blocking
function "rec." This way you can simply send, and read only when
you have data to read.


Share this post

Link to post
Share on other sites
Another way to do this is to use non-blocking sockets or async-sockets.
You''ll find tutors for both here on gamedev.net

@ Async sockets windows tells you WM_READ,... if something is to read. very handy.

@ non blocking are for 16 bit apps and a bit different.

Just look @ the tutors.

Nate Miller has a cool nonblocking example with source to look at !

I hope this helps

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!