Winsock WSAAsyncSelect Question
Let's say that I have a several clients connected to a server, and therefore have several references to client connection sockets stored in the server. When an FB_READ message is received, how do I know which connection socket I should call recv() on? ...stip
The variable "wParam" that is passed whenever you get a WSAASYNC notice is your socket, so you could call, say,
recv(wParam, (char*)&data, sizeof(data));
And it will always be the socket you got data from. Pretty nifty.
recv(wParam, (char*)&data, sizeof(data));
And it will always be the socket you got data from. Pretty nifty.
It only takes one mistake to wake up dead the next morning.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement