fix error on resubmit thread, do not throw exception on close method with already closed connection, added ability to resend failed messages