Change to non-blocking sockets using select