@Override public void onWebSocketConnect(final Session session) { super.onWebSocketConnect(session); if (sessionId == null || sessionId.isEmpty()) { // If sessionId is already assigned to this instance, don't publish new one. // So that existing sesionId can be reused when reconnecting. sessionId = UUID.randomUUID().toString(); } final JettyWebSocketSession webSocketSession = new JettyWebSocketSession(sessionId, session); router.captureSession(webSocketSession); }
@Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); sess.setIdleTimeout(10000); }
@Override public void onWebSocketConnect(Session session) { super.onWebSocketConnect(session); Map<String, Collection<?>> data = new HashMap<>(); data.put(KEY_POSITIONS, Context.getDeviceManager().getInitialState(userId)); sendData(data); Context.getConnectionManager().addListener(userId, this); }
/** * {@inheritDoc} * </p> * Handles the event of this web socket being connected. Finds the * destination COLIBRI {@link Endpoint} and authenticates the request * based on the password. */ @Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); endpoint.onWebSocketConnect(this); }
@Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); connectionManager.add(this); connectionManager.broadcastToSession(this); }
@Override public void onWebSocketConnect(Session session) { super.onWebSocketConnect(session); }
@Override public void onWebSocketConnect(Session sess) { Discord4J.LOGGER.info(LogMarkers.WEBSOCKET, "Websocket Connected."); super.onWebSocketConnect(sess); }
@Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); System.out.println("Socket Connected: " + sess); }
@Override public void onWebSocketConnect(Session session) { super.onWebSocketConnect(session); log.info("[{}] New WebSocket session on topic {}", session.getRemoteAddress(), topic); }
@Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); if (log.isLoggable(Logger.FINE)) { log.fine(CLASS_NAME, "onWebSocketConnect", "116", new Object[] { uri.toString() + ", WebSocket CONNECTED." }); } }
@Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); listener = listenerFactory.createListener(sess); events.addClient(listener); }
@Override public void onWebSocketConnect(Session sess) { super.onWebSocketConnect(sess); Discord4J.LOGGER.info(LogMarkers.VOICE_WEBSOCKET, "Voice Websocket Connected."); send(VoiceOps.IDENTIFY, new VoiceIdentifyRequest(guild.getStringID(), shard.getClient().getOurUser().getStringID(), shard.ws.sessionId, token)); }
@Override public void onWebSocketConnect(final Session sess) { super.onWebSocketConnect(sess); id = WsPool.add(this); run("[WS-OPEN] " + req.getRequestURL(), null, () -> { // add headers (for binding them to the XQuery parameters in the corresponding bind method) final UpgradeRequest ur = sess.getUpgradeRequest(); final BiConsumer<String, String> addHeader = (k, v) -> { if(v != null) headers.put(k, new Atm(v)); }; addHeader.accept("http-version", ur.getHttpVersion()); addHeader.accept("origin", ur.getOrigin()); addHeader.accept("protocol-version", ur.getProtocolVersion()); addHeader.accept("query-string", ur.getQueryString()); addHeader.accept("is-secure", String.valueOf(ur.isSecure())); addHeader.accept("request-uri", ur.getRequestURI().toString()); addHeader.accept("host", ur.getHost()); final TokenList protocols = new TokenList(); for(final String protocol : ur.getSubProtocols()) protocols.add(protocol); headers.put("sub-protocols", StrSeq.get(protocols)); findAndProcess(Annotation._WS_CONNECT, null); }); }
@Override public void onWebSocketConnect(final Session session) { if (listener_ != null) { listener_.onWebSocketConnect(session); } super.onWebSocketConnect(session); readyState_ = OPEN; outgoingSession_ = session; final Event openEvent = new Event(); openEvent.setType(Event.TYPE_OPEN); fire(openEvent); callFunction(openHandler_, ArrayUtils.EMPTY_OBJECT_ARRAY); }
@Override public void onWebSocketConnect(final Session session) { if (listener_ != null) { listener_.onWebSocketConnect(session); } super.onWebSocketConnect(session); readyState_ = OPEN; outgoingSession_ = session; final Event openEvent = new Event(); openEvent.setType(Event.TYPE_OPEN); fire(openEvent); callFunction(openHandler_, ArrayUtils.EMPTY_OBJECT_ARRAY); }
@Override public void onWebSocketConnect(final Session frontEndSession) { /* * Let's connect to the backend, this is where the Backend-to-frontend * plumbing takes place */ container = ContainerProvider.getWebSocketContainer(); final ProxyInboundClient backendSocket = new ProxyInboundClient(getMessageCallback()); /* build the configuration */ /* Attempt Connect */ try { backendSession = container.connectToServer(backendSocket, clientConfig, backend); LOG.onConnectionOpen(backend.toString()); } catch (DeploymentException e) { LOG.connectionFailed(e); throw new RuntimeException(e); } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } super.onWebSocketConnect(frontEndSession); this.frontendSession = frontEndSession; }
@Override public void onWebSocketConnect(final Session frontEndSession) { /* * Let's connect to the backend, this is where the Backend-to-frontend * plumbing takes place */ container = ContainerProvider.getWebSocketContainer(); final ProxyInboundClient backendSocket = new ProxyInboundClient(getMessageCallback()); /* build the configuration */ /* Attempt Connect */ try { backendSession = container.connectToServer(backendSocket, clientConfig, backend); LOG.onConnectionOpen(backend.toString()); } catch (DeploymentException e) { LOG.connectionFailed(e); throw new RuntimeException(e); } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } super.onWebSocketConnect(frontEndSession); this.frontendSession = frontEndSession; }