@Override protected void handleConnected(CommandConnected connected) { if (isTlsHostnameVerificationEnable && remoteHostName != null && !verifyTlsHostName(remoteHostName, ctx)) { // close the connection if host-verification failed with the broker log.warn("[{}] Failed to verify hostname of {}", ctx.channel(), remoteHostName); ctx.close(); return; } checkArgument(state == State.SentConnectFrame); if (log.isDebugEnabled()) { log.debug("{} Connection is ready", ctx.channel()); } // set remote protocol version to the correct version before we complete the connection future remoteEndpointProtocolVersion = connected.getProtocolVersion(); connectionFuture.complete(null); state = State.Ready; }
@Override protected void handleConnected(CommandConnected connected) { if (isTlsHostnameVerificationEnable && remoteHostName != null && !verifyTlsHostName(remoteHostName, ctx)) { // close the connection if host-verification failed with the broker log.warn("[{}] Failed to verify hostname of {}", ctx.channel(), remoteHostName); ctx.close(); return; } checkArgument(state == State.SentConnectFrame); if (log.isDebugEnabled()) { log.debug("{} Connection is ready", ctx.channel()); } // set remote protocol version to the correct version before we complete the connection future remoteEndpointProtocolVersion = connected.getProtocolVersion(); connectionFuture.complete(null); state = State.Ready; }
@Override protected void handleConnected(CommandConnected connected) { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received Connected from broker", inboundChannel, outboundChannel); } if (config.isTlsHostnameVerificationEnabled() && remoteHostName != null && !verifyTlsHostName(remoteHostName, ctx)) { // close the connection if host-verification failed with the // broker log.warn("[{}] Failed to verify hostname of {}", ctx.channel(), remoteHostName); ctx.close(); return; } state = BackendState.HandshakeCompleted; inboundChannel.writeAndFlush(Commands.newConnected(connected.getProtocolVersion())).addListener(future -> { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Removing decoder from pipeline", inboundChannel, outboundChannel); } inboundChannel.pipeline().remove("frameDecoder"); outboundChannel.pipeline().remove("frameDecoder"); // Start reading from both connections inboundChannel.read(); outboundChannel.read(); }); }
public Builder mergeFrom(org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected other) { if (other == org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance()) return this; if (other.hasServerVersion()) { setServerVersion(other.getServerVersion()); } if (other.hasProtocolVersion()) { setProtocolVersion(other.getProtocolVersion()); } return this; }
public Builder mergeFrom(org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected other) { if (other == org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance()) return this; if (other.hasServerVersion()) { setServerVersion(other.getServerVersion()); } if (other.hasProtocolVersion()) { setProtocolVersion(other.getProtocolVersion()); } return this; }