here goes....

i am writing a client socket function. i have 2 threads running

one thread will receive from the server. ret_val;

ret_val = recv( socket, buff, sizeof(buff), 0);

since i am using blocking i/o , my thread will stop here until
i receive something from the server.

the problem is, when my other thread close the socket,
this thread is still waiting for a message from the server.
it will not return an error to my ret_val unlike the window

help....what other ways that i can use to make my thread
exit gracefully, or better still return from the recv() funtion without
killing the thread????