fixed non-blocking select loop on server and client