With winsock, and when you recieve the FD_READ state. Do you have to loop through all your sockets for the server, to determine what socket actually sent the server something. Or am I doing this backwards??
Kevin Ennis
"Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it." - Samuel Johnson
Are you getting the FD_READ from a select, a WSAAsyncSelect, or a WSAEventSelect? The select should set the flags for the FD_SET object passed as the read paramter. The WSAAsyncSelect should send the socket as the WPARAM of the windows message. I can''t remember how the WSAEventSelect signals which socket was passed off the top of my head.
Thanks, not sure why I didn''t think of the wparam being the socket. I guess I assumed *cough* that since I used the wparam to get what the event was, it didn''t hold the socket. But now that saves wonders.
Kevin Ennis
Kevin Ennis
"Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it." - Samuel Johnson
The low word of the LPARAM is the socket event; WPARAM should only hold the socket identifier.
Oh, Okay. I just can''t read. I was using lparam for the event and the error. D''uh.
Thanks for the info, makes it much easier then looping through every socket to find out what socket actually sent something.
Kevin Ennis
Thanks for the info, makes it much easier then looping through every socket to find out what socket actually sent something.
Kevin Ennis
"Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it." - Samuel Johnson
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement