Use socket.setTimeout