Example usage for org.springframework.web.socket.messaging SubProtocolHandler handleMessageFromClient

List of usage examples for org.springframework.web.socket.messaging SubProtocolHandler handleMessageFromClient

Introduction

In this page you can find the example usage for org.springframework.web.socket.messaging SubProtocolHandler handleMessageFromClient.

Prototype

void handleMessageFromClient(WebSocketSession session, WebSocketMessage<?> message,
        MessageChannel outputChannel) throws Exception;

Source Link

Document

Handle the given WebSocketMessage received from a client.

Usage

From source file:org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.java

/**
 * Handle an inbound message from a WebSocket client.
 *///from w  ww.  java  2 s .  com
@Override
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
    WebSocketSessionHolder holder = this.sessions.get(session.getId());
    if (holder != null) {
        session = holder.getSession();
    }
    SubProtocolHandler protocolHandler = findProtocolHandler(session);
    protocolHandler.handleMessageFromClient(session, message, this.clientInboundChannel);
    if (holder != null) {
        holder.setHasHandledMessages();
    }
    checkSessions();
}