private BlockingChannel getBlockingChannelBasedOnPortType(String host, int port) throws SocketException {
    BlockingChannel channel;
    if (this.port.getPortType() == PortType.PLAINTEXT) {
      channel = new BlockingChannel(host, port, config);
    } else if (this.port.getPortType() == PortType.SSL) {
      channel = new SSLBlockingChannel(host, port, registry, config, sslSocketFactory, sslConfig);
    } else {
      throw new SocketException("No port type: " + this.port.getPortType());
    }
    return channel;
  }
Returns BlockingChannel or SSLBlockingChannel depending on whether the port type is PlainText or SSL
@param host upon which connection has to be established
@param port upon which connection has to be established
@return BlockingChannel
ambry-network/src/main/java/com/github/ambry/network/BlockingChannelInfo.java