There is a thread likes this:
{
......
while (1)
{
recv(socket, buffer, sizeof(buffer), 0);
......
}
close(socket);
}
Because the thread is blocking on recv() call, how can I let the thread exit gracefully?