remove socket timeout and use sendall

instead of using non-blocking sockets.