if the server connection is lost, send all the messages when the connection success again