recv() is not coming out of blocking after closing the socket.
Hi All
I have a server which is mutithreaded. One of the thread is blocking on recv(), If from another thread i close the socket, the recv() is not coming out of blocking. If i do the same in windows it is working correctly. Can anyone help?? Thanks in advance Arun KA |
Is the close successful? There might be something like a usage count on the file handle for the socket and until its 0 the socket remains open. Each thread might add to that usage count. I haven't done this stuff in a while but chances are your code needs to be rewritten to get the desired effect. Post a little more information about what you're trying to do and the situation perhaps?
|
I'm not sure offhand, but the behavior could be due to the differences in thread semantics between Windows and Linux. You could set the file descriptor nonblocking and periodically check and make sure that the file descriptor hasn't been closed.
|
All times are GMT -5. The time now is 02:51 AM. |