Don't call socket.close() immediately otherwise some data might not go out
1.0.4