/* (non-Javadoc)
@see net.timewalker.ffmq4.transport.tcp.AbstractTcpPacketTransport#getRemotePeer()
199092
@Override
	public SocketAddress getRemotePeer()
    {
    	Socket sock = socket;
    	return sock != null ? sock.getRemoteSocketAddress() : null;
    }
29392
public InetAddress getRemoteAddress() throws IOException {
        return InetAddress.getByName(
            new RqHeaders.Smart(new RqHeaders.Base(this))
                .single("X-Takes-RemoteAddress")
        );
    }
1163927
public SIMPRemoteConsumerReceiverControllable getRemoteConsumerReceiver()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getRemoteConsumerReceiver");
      
    AIStream aiStream = _anycastInputHandler.getAIStream();                 
    SIMPRemoteConsumerReceiverControllable remoteConsumerReceiverControl = null;

    if(aiStream!=null)
      remoteConsumerReceiverControl = (SIMPRemoteConsumerReceiverControllable)aiStream.getControlAdapter();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteConsumerReceiver", remoteConsumerReceiverControl);
    return remoteConsumerReceiverControl;
  }
1152555
@Override
    public String getRemoteHostName () {
        try ( SmbSessionImpl session = this.treeConnection.getSession();
              SmbTransportImpl transport = session.getTransport() ) {
            return transport.getRemoteHostName();
        }
    }
427649
public static SocketAddress getRemoteAddress(AsynchronousSocketChannel channel) {
		try {
			return (null == channel) ? null : channel.getRemoteAddress();
		} catch (ClosedChannelException e) {
			// Channel未打开或已关闭，返回null表示未连接
			return null;
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
1310372
public static InetAddress getRemoteIp() {
    Call call = CurCall.get();
    if (call != null) {
      return call.connection.socket.getInetAddress();
    }
    return null;
  }
559781
public static Transport getTransport(SocketAddress addr) throws IOException {
        Transport trans;
        try {
            log.debug("Connecting TCP");
            trans = TCPInstance(addr);
            if (!trans.test()) {
                throw new IOException("Agent is unreachable via TCP");
            }
            return trans;
        } catch (IOException e) {
            log.info("Can't connect TCP transport for host: " + addr.toString(), e);
            try {
                log.debug("Connecting UDP");
                trans = UDPInstance(addr);
                if (!trans.test()) {
                    throw new IOException("Agent is unreachable via UDP");
                }
                return trans;
            } catch (IOException ex) {
                log.info("Can't connect UDP transport for host: " + addr.toString(), ex);
                throw ex;
            }
        }
    }
266185
public SIMPIterator getRemoteBrowserReceiverIterator()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getRemoteBrowserReceiverIterator");
    
    AnycastOutputHandler aoh = destinationHandler.getAnycastOutputHandler();
    
    // Get the hashtable of all the browserSessions that are currently active
    Hashtable tableOfBrowserSessions = aoh.getBrowserSessions();
    
    // Get all the keys (AOBrowserSessionKey) that are contained in the table
    Set keySet = tableOfBrowserSessions.keySet();
    
    // Create our new list which we will passed to the RemoteBrowserIterator 
    List<AOBrowserSession> listOfBrowserSessions = new ArrayList<AOBrowserSession>();
    
    // For all the keys in the table
    for (Iterator iter = keySet.iterator(); iter.hasNext();)
    {
      // Get the first key
      AOBrowserSessionKey browserSessionKey = (AOBrowserSessionKey) iter.next();
      // Get the AOBrowserSession for this key
      AOBrowserSession aoBrowserSession = (AOBrowserSession) tableOfBrowserSessions.get(browserSessionKey);
      // Add the session to our new list
      listOfBrowserSessions.add(aoBrowserSession);
    }
    
    RemoteBrowserIterator remoteBrowserIterator = new RemoteBrowserIterator(listOfBrowserSessions.iterator());
          
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getRemoteBrowserReceiverIterator", remoteBrowserIterator);
    return remoteBrowserIterator;
  }
1241672
@Override
	public TServerTransport getTransport() throws TTransportException {
		if (serverSocket == null) {
			TSSLTransportParameters params = getServerConfiguration().getSslTransportParameters();
			serverSocket = params == null ? new TServerSocket(getServerPort())
					: TSSLTransportFactory.getServerSocket(getServerPort(), 0, null, params);
		}
		return serverSocket;
	}
650698
@Override
    public String getRemoteHost() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getRemoteHost();
        return null;
    }
456745
public SIBUuid8 getRemoteMEUuid() throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getRemoteMEUuid");
    
    SIBUuid8 remoteMEUuid = getLinkStateHandler().getRemoteMEUuid(getUuid());
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
       SibTr.exit(tc, "getRemoteMEUuid", remoteMEUuid);
         
    return remoteMEUuid;
  }
50950
@Override
    public String getRemoteHost() {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getRemoteHost();
        } finally {
            collaborator.postInvoke();
        }
    }
1226898
@Override
  public int getRemoteAddress(byte []buffer, int offset, int length)
  {
    int len = _remoteAddrLength;

    if (len <= 0) {
      len = _remoteAddrLength = InetAddressUtil.createIpAddress(_remoteAddrBuffer,
                                                                _remoteAddrCharBuffer);
    }

    char []charBuffer = _remoteAddrCharBuffer;

    for (int i = len - 1; i >= 0; i--) {
      buffer[offset + i] = (byte) charBuffer[i];
    }

    return len;
  }
44876
public String getRemoteHost()
  {
    InetAddress remoteAddress = addressRemote();
    
    if (remoteAddress != null)
      return remoteAddress.getHostAddress();
    else
      return null;
  }
1236066
public SIMPIterator getRemoteConsumerTransmit()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getRemoteConsumerTransmitIterator");

    SIMPIterator remoteConsumerTransmitIterator = null;
    
    BaseDestinationHandler destinationHandler = consumerDispatcher.getDestination();  
    String subName = consumerDispatcherState.getSubscriberID();
    String pseudoDestName = destinationHandler.constructPseudoDurableDestName(subName);
    AnycastOutputHandler aoh = destinationHandler.getAnycastOHForPseudoDest(pseudoDestName);
    
    if(aoh!=null)
      remoteConsumerTransmitIterator = new BasicSIMPIterator(aoh.getAOControlAdapterIterator());
    else // Create an empty iterator
      remoteConsumerTransmitIterator = new BasicSIMPIterator(new LinkedList().iterator());

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteConsumerTransmitIterator", remoteConsumerTransmitIterator);

    return remoteConsumerTransmitIterator;
  }
682351
public static WsonrpcRemote getRemote(String sessionId) {
        if (sessionId == null) {
            return null;
        }
        return remotes.get(sessionId);
    }
337533
public InetSocketAddress getRemoteAddress()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getRemoteAddress");
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getRemoteAddress","rc="+remoteAddress);
      return remoteAddress;
   }