private void handshakeComplete(ChannelHandlerContext ctx, FullHttpResponse response) { handshaking = false; ChannelHandler handler = ctx.pipeline().get(HttpContentDecompressor.class); if (handler != null) { // remove decompressor as its not needed anymore once connection was upgraded to websockets ctx.pipeline().remove(handler); } WebSocketImpl webSocket = new WebSocketImpl(vertx, Http1xClientConnection.this, supportsContinuation, options.getMaxWebsocketFrameSize(), options.getMaxWebsocketMessageSize()); ws = webSocket; handshaker.finishHandshake(chctx.channel(), response); ws.subProtocol(handshaker.actualSubprotocol()); context.executeFromIO(v -> { log.debug("WebSocket handshake complete"); if (metrics != null ) { webSocket.setMetric(metrics.connected(endpointMetric, metric(), webSocket)); } webSocket.registerHandler(vertx.eventBus()); wsConnect.handle(webSocket); }); } }
if (metrics != null) { context.executeFromIO(v -> { Object socketMetric = metrics.connected(conn.remoteAddress(), conn.remoteName()); conn.metric(socketMetric); metrics.endpointConnected(endpointMetric, socketMetric);
Object m = socketMetric; if (m == null) { m = metrics.connected(conn.remoteAddress(), conn.remoteName()); metrics.endpointConnected(queueMetric, m);
private void handshakeComplete(ChannelHandlerContext ctx, FullHttpResponse response) { handshaking = false; ChannelHandler handler = ctx.pipeline().get(HttpContentDecompressor.class); if (handler != null) { // remove decompressor as its not needed anymore once connection was upgraded to websockets ctx.pipeline().remove(handler); } WebSocketImpl webSocket = new WebSocketImpl(vertx, Http1xClientConnection.this, supportsContinuation, options.getMaxWebsocketFrameSize(), options.getMaxWebsocketMessageSize()); ws = webSocket; handshaker.finishHandshake(chctx.channel(), response); ws.subProtocol(handshaker.actualSubprotocol()); context.executeFromIO(v -> { log.debug("WebSocket handshake complete"); if (metrics != null ) { webSocket.setMetric(metrics.connected(endpointMetric, metric(), webSocket)); } webSocket.registerHandler(vertx.eventBus()); wsConnect.handle(webSocket); }); } }
if (metrics != null) { context.executeFromIO(v -> { Object socketMetric = metrics.connected(conn.remoteAddress(), conn.remoteName()); conn.metric(socketMetric); metrics.endpointConnected(endpointMetric, socketMetric);
Object m = socketMetric; if (m == null) { m = metrics.connected(conn.remoteAddress(), conn.remoteName()); metrics.endpointConnected(queueMetric, m);