Bug fix: when there is an error sending over TCP, just disconnect the socket.