Example usage for org.springframework.web.socket PongMessage PongMessage

List of usage examples for org.springframework.web.socket PongMessage PongMessage

Introduction

In this page you can find the example usage for org.springframework.web.socket PongMessage PongMessage.

Prototype

public PongMessage(ByteBuffer payload) 

Source Link

Document

Create a new pong message with the given ByteBuffer payload.

Usage

From source file:org.springframework.web.socket.adapter.jetty.JettyWebSocketHandlerAdapter.java

@OnWebSocketFrame
public void onWebSocketFrame(Frame frame) {
    if (OpCode.PONG == frame.getOpCode()) {
        ByteBuffer payload = frame.getPayload() != null ? frame.getPayload() : EMPTY_PAYLOAD;
        PongMessage message = new PongMessage(payload);
        try {//from w  ww  . ja v  a 2s .c  om
            this.webSocketHandler.handleMessage(this.wsSession, message);
        } catch (Throwable ex) {
            ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
        }
    }
}

From source file:org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.java

private void handlePongMessage(javax.websocket.Session session, ByteBuffer payload) {
    PongMessage pongMessage = new PongMessage(payload);
    try {//from  ww w . jav  a2s.c o  m
        this.handler.handleMessage(this.wsSession, pongMessage);
    } catch (Throwable ex) {
        ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
    }
}

From source file:org.springframework.web.socket.adapter.StandardWebSocketHandlerAdapter.java

private void handlePongMessage(javax.websocket.Session session, ByteBuffer payload) {
    PongMessage pongMessage = new PongMessage(payload);
    try {// w  w  w.j  a v  a 2 s  .c  om
        this.handler.handleMessage(this.wsSession, pongMessage);
    } catch (Throwable t) {
        ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, t, logger);
    }
}