Use socket timeouts instead of non-blocking sockets