Asynchronous Sockets and Server-Side send()
Using asynchronous sockets, could I (when I get the FD_ACCEPT notification in WinProc as the server) call send() immediately after calling accept()? Or do I have to wait for the client to recieve the FD_CONNECT notification?
Absolutely. You can call send() right after accept(). Generally, check out the non-blocking winsock API such as WSAAccept() and WSASend().
Kuphryn
Kuphryn
Really? When I get the message on the client program via a FD_READ notification, recv() returns -1 and WSAGetLastError returns WSAEWOULDBLOCK, and no other FD_READ notification gets sent. Am I just supposed to while(1) recv() or something until it works?
[Edited by - jtmerchant on March 5, 2005 9:55:12 AM]
[Edited by - jtmerchant on March 5, 2005 9:55:12 AM]
Oh and the server gets WSAENOTCONN from WSAGetLastError() after send() returns SOCKET_ERROR.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement