What causes connection reset?
More commonly, it is caused by writing to a connection that the other end has already closed normally. In other words an application protocol error. A Reset (RST) packet is received from a remote machine and interrupts the established connection.