I try to use web socket for messages (Glassfish 4 implementation). When I use session.getBasicRemote().sendText
it works correctly but if I use session.getAsyncRemote().sendText
some messages are lost. For example:
for (int i = 0; i < 200; i++) {
session.getBasicRemote().sendText("{id: " + envelope.id + ", message: \"dddd\"}");
}
But the client receive around 190-195 messages.