Example usage for org.springframework.web.socket.sockjs.frame SockJsFrame getType

List of usage examples for org.springframework.web.socket.sockjs.frame SockJsFrame getType

Introduction

In this page you can find the example usage for org.springframework.web.socket.sockjs.frame SockJsFrame getType.

Prototype

public SockJsFrameType getType() 

Source Link

Document

Return the SockJS frame type.

Usage

From source file:org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession.java

public void handleFrame(String payload) {
    SockJsFrame frame = new SockJsFrame(payload);
    switch (frame.getType()) {
    case OPEN:/*from w  w w  .j a v  a 2  s.c  om*/
        handleOpenFrame();
        break;
    case HEARTBEAT:
        if (logger.isTraceEnabled()) {
            logger.trace("Received heartbeat in " + this);
        }
        break;
    case MESSAGE:
        handleMessageFrame(frame);
        break;
    case CLOSE:
        handleCloseFrame(frame);
    }
}