Example usage for org.springframework.web.socket WebSocketSession getLocalAddress

List of usage examples for org.springframework.web.socket WebSocketSession getLocalAddress

Introduction

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

Prototype

@Nullable
InetSocketAddress getLocalAddress();

Source Link

Document

Return the address on which the request was received.

Usage

From source file:com.github.mrstampy.gameboot.websocket.AbstractWebSocketProcessor.java

@Override
public <AGBM extends AbstractGameBootMessage> Response process(WebSocketSession session,
        GameBootMessageController controller, AGBM agbm) throws Exception {
    agbm.setSystemId(getSystemId(session));
    agbm.setTransport(Transport.WEB_SOCKET);
    agbm.setLocal((InetSocketAddress) session.getLocalAddress());
    agbm.setRemote((InetSocketAddress) session.getRemoteAddress());

    Response r = controller.process(agbm);
    processMappingKeys(r, session);//from   ww w. ja va  2s  .c o m
    r.setSystemId(agbm.getSystemId());

    return r;
}