okay, at first i was working with non-blocking sockets, but then when i was trying to catch individual events from multiple users, it quickly became cluttered and innaccurate. So much so, that i think even multithreading is a better alternative, just using mutexes. But i've got a problem. in each thread for each connection, it is supposed to block at recv and wait indefinately, but then, let's say that i wish to shutdown the server, and end the thread mid recv? is there anyway to force recv to return immediately? does setting the socket to non-blocking mode from another thread, mid recv, maybe cause it to return or does it HAVE to be set before recv is called?