fixed an exception that the socket session has been closed when sending data