Skip to main content
gamedev.net
🔒 Locked

FD_READ message

Started by Greg K May 18, 2003 at 12:45 PM 1 replies 450+ views
Original Post
Greg K
Greg K
When is the FD_READ flag sent out? If I call recv() and do not receive all the data will it be sent out again? Or is it only when the buffer was empty and now has data in it?
johnnie2
johnnie2
To answer your specific question, if you call recv() and do not receive all of the data ready to be copied, FD_READ will be sent again. You''ll continue to receive an FD_READ on successive calls to recv() until all data in the network buffer has been acknowledged (copied) by your program.

In general, FD_READ is sent:

  • When WSAAsyncSelect() is called, if there is data waiting to be received.

  • When new data arrives on a socket.

  • And in the case discussed above, in which the program has copied a portion of the available data from the network buffer.



________________________________________________
RapscallionGL development continues...
"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C
____________"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.