Dieing for an Example of Async Sockets.
I''ve read the wonderful Tutorial and I understand it Im just not sure where to place my code and how to change up my existing Blocking WinSock App.
Anyone happen to have any source code that shows Async sockets? or know another tutorial that displays the entire code so I can see where to put the Message pump and how to set up Async?
I tried google but couldnt find anything decent.
Visit http://www.sockaddr.com/ExampleSourceCode.html and scroll down to the advanced examples, where you''ll find a link to a server source utilizing asynchronous sockets.
Really, all you must do is define your own message value, send it off with the call to WSAAsyncSelect() along with flags indicating on which events you would like to receive a notification, and place an extra case statement for the message value in your window procedure switch. The greatest difficulty you''ll have is realizing that recv() will now return immediately rather than waiting for the specified buffer to be filled with data and implementing a solution that takes this into consideration.
Really, all you must do is define your own message value, send it off with the call to WSAAsyncSelect() along with flags indicating on which events you would like to receive a notification, and place an extra case statement for the message value in your window procedure switch. The greatest difficulty you''ll have is realizing that recv() will now return immediately rather than waiting for the specified buffer to be filled with data and implementing a solution that takes this into consideration.
________________________________________________"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement