wait until the server receives the messages