Package io.undertow.websockets.jsr

Examples of io.undertow.websockets.jsr.EndpointSessionHandler


    final ServletWebSocketHttpExchange exchange = createHttpExchange(servletRequest, servletResponse);
    exchange.putAttachment(HandshakeUtil.PATH_PARAMS, Collections.<String, String>emptyMap());

    ServerWebSocketContainer wsContainer = (ServerWebSocketContainer) getContainer(servletRequest);
    final EndpointSessionHandler endpointSessionHandler = new EndpointSessionHandler(wsContainer);

    final ConfiguredServerEndpoint configuredServerEndpoint = createConfiguredServerEndpoint(
        selectedProtocol, selectedExtensions, endpoint, servletRequest);

    final Handshake handshake = getHandshakeToUse(exchange, configuredServerEndpoint);

    exchange.upgradeChannel(new HttpUpgradeListener() {
      @Override
      public void handleUpgrade(StreamConnection connection, HttpServerExchange serverExchange) {
        WebSocketChannel channel = handshake.createChannel(exchange, connection, exchange.getBufferPool());
        if (peerConnections != null) {
          peerConnections.add(channel);
        }
        endpointSessionHandler.onConnect(exchange, channel);
      }
    });

    handshake.handshake(exchange);
  }
View Full Code Here

TOP

Related Classes of io.undertow.websockets.jsr.EndpointSessionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.