code: public void setIoSession(IoSession protocolSession) {
          SocketAddress remote = protocolSession.getRemoteAddress();
          if (remote instanceof InetSocketAddress) {
              remoteAddress = ((InetSocketAddress) remote).getAddress().getHostAddress();
              remotePort = ((InetSocketAddress) remote).getPort();
          } else {
              remoteAddress = remote.toString();
              remotePort = -1;
          }
          remoteAddresses = new ArrayList<String>(1);
          remoteAddresses.add(remoteAddress);
          remoteAddresses = Collections.unmodifiableList(remoteAddresses);
          this.ioSession = protocolSession;
          if (log.isTraceEnabled()) {
              log.trace("setIoSession conn: {}", this);
          }
      }
docs: Setter for MINA I/O session (connection).
  
  @param protocolSession
  Protocol session