Handle PONG messages in WebSocket handlers
See gh-534
This commit is contained in:
@@ -183,6 +183,9 @@ public class GraphQlWebSocketHandler implements WebSocketHandler {
|
|||||||
case PING -> {
|
case PING -> {
|
||||||
return Flux.just(this.codecDelegate.encode(session, GraphQlWebSocketMessage.pong(null)));
|
return Flux.just(this.codecDelegate.encode(session, GraphQlWebSocketMessage.pong(null)));
|
||||||
}
|
}
|
||||||
|
case PONG -> {
|
||||||
|
return Flux.empty();
|
||||||
|
}
|
||||||
case COMPLETE -> {
|
case COMPLETE -> {
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
Subscription subscription = subscriptions.remove(id);
|
Subscription subscription = subscriptions.remove(id);
|
||||||
|
|||||||
@@ -248,6 +248,8 @@ public class GraphQlWebSocketHandler extends TextWebSocketHandler implements Sub
|
|||||||
ExceptionWebSocketHandlerDecorator.tryCloseWithError(session, ex, logger);
|
ExceptionWebSocketHandlerDecorator.tryCloseWithError(session, ex, logger);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
case PONG -> {
|
||||||
|
}
|
||||||
case COMPLETE -> {
|
case COMPLETE -> {
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
Subscription subscription = state.getSubscriptions().remove(id);
|
Subscription subscription = state.getSubscriptions().remove(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user