/*
(non-Javadoc)
@see javax.servlet.sip.SipServletMessage#getLocalPort()
177291
public int getLocalPort() {
		final SIPTransaction sipTransaction = (SIPTransaction)getTransaction();
		if(sipTransaction != null) {
			return sipTransaction.getPort();
		} else {
			final String transport = JainSipUtils.findTransport(message);
			final MobicentsExtendedListeningPoint listeningPoint = sipFactoryImpl.getSipNetworkInterfaceManager().findMatchingListeningPoint(transport, false);
			return listeningPoint.getPort();
		}
	}
1143505
@Override
  public InetSocketAddress ipLocal()
  {
    SocketChannel s = _channel;
    
    if (s != null) {
      try {
        return (InetSocketAddress) s.getLocalAddress();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    else {
      return null;
    }
  }
1370497
public String getLocalTag() {
		if (localTag == null) {
			if (wrappedDialog != null) {
				localTag = wrappedDialog.getLocalTag();
			}
		}
		return localTag;
	}
853359
public static ByteBuf threadLocalDirectBuffer() {
        if (THREAD_LOCAL_BUFFER_SIZE <= 0) {
            return null;
        }

        if (PlatformDependent.hasUnsafe()) {
            return ThreadLocalUnsafeDirectByteBuf.newInstance();
        } else {
            return ThreadLocalDirectByteBuf.newInstance();
        }
    }
1361187
@Override
  public InetAddress addressLocal()
  {
    SocketChannel s = _channel;
    
    if (s != null) {
      try {
        InetSocketAddress addr = (InetSocketAddress) s.getLocalAddress();
        
        return addr.getAddress();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    else {
      return null;
    }
  }
1138147
public static String getLocalIpv4() {
        InetAddress address = getLocalAddress();
        return address == null ? null : address.getHostAddress();
    }
230852
private String determinateLocalIP() throws IOException {
		Socket socket = null;

		try {
			URL url = new URL(defaultRepositoryUrl);
			int port = url.getPort() > -1 ? url.getPort() : url.getDefaultPort();

			log.debug("Determinating local IP-Adress by connect to {}:{}", defaultRepositoryUrl, port);
			InetAddress address = Inet4Address.getByName(url.getHost());

			socket = new Socket();
			socket.connect(new InetSocketAddress(address, port), 3000);
			InputStream stream = socket.getInputStream();
			InetAddress localAddress = socket.getLocalAddress();
			stream.close();

			String localIp = localAddress.getHostAddress();

			log.info("Local IP-Adress is {}", localIp);

			return localIp;
		} finally {
			if (socket != null) {
				socket.close();
			}
		}
	}
118340
@Trivial
    @Override
    public String getLocalName() {
        String addr = this.connection.getLocalHostName(true);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getLocalName: " + addr);
        }
        return addr;
    }
1176498
public static String getLocalIp() throws RuntimeException
	{
		try
		{
			InetAddress addr = getLocalIpAddress();

			return addr.getHostAddress();
		}
		catch (RuntimeException e)
		{
			throw new RuntimeException("[FileHelper] {getLocalIp}: Unable to find the local machine", e);
		}
	}
48576
public String getLocalName()
    {
        HttpConnection connection= _httpRequest.getHttpConnection();
        if (connection!=null)
            return connection.getServerName();
        return null;
    }
993918
public static int openAndBindPortToLocal(Connector sshConn, String remoteHost, int remotePort) throws JschRuntimeException {
		final Session session = openSession(sshConn.getHost(), sshConn.getPort(), sshConn.getUser(), sshConn.getPassword());
		if (session == null) {
			throw new JschRuntimeException("Error to create SSH Session！");
		}
		final int localPort = generateLocalPort();
		bindPort(session, remoteHost, remotePort, localPort);
		return localPort;
	}
729425
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.FeedServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.FeedServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.FeedServiceSoapBindingStub(new java.net.URL(FeedServiceInterfacePort_address), this);
                _stub.setPortName(getFeedServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
872872
SocketAddress getLocalSocketAddress() {
        // a lot could go wrong here, so rather than put in a bunch of code
        // to check for nulls all down the chain let's do it the simple
        // yet bulletproof way
        try {
            return ((SocketChannel) sendThread.sockKey.channel()).socket()
                    .getLocalSocketAddress();
        } catch (NullPointerException e) {
            return null;
        }
    }
505725
public String getLocalName() {
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        // 321485
        String name = this._request.getLocalName();
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"getLocalName", " name --> " + name);
        }
        return name;
    }
853605
public int getRemotePort() {
		int port = -1;

		if(getTransaction() != null) {
			if(((SIPTransaction)getTransaction()).getPeerPacketSourceAddress() != null) {
				port = ((SIPTransaction)getTransaction()).getPeerPacketSourcePort();
			} else {
				port = ((SIPTransaction)getTransaction()).getPeerPort();
			}
		} else {
			ViaHeader via = (ViaHeader) message.getHeader(ViaHeader.NAME);
			// https://code.google.com/p/sipservlets/issues/detail?id=137
            boolean isExternal = sipFactoryImpl.getSipApplicationDispatcher().isViaHeaderExternal(via);
            if(message instanceof Request && !isExternal) {
                // locally generated messages should return -1 as per Javadoc
                return -1;
            }
			if(via != null) {
				port = via.getPort();
			}
		}
		if(port<=0) {
			return 5060;
		}
		else {
			return port;
		}
	}
505781
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201808.NativeStyleServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201808.NativeStyleServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201808.NativeStyleServiceSoapBindingStub(new java.net.URL(NativeStyleServiceInterfacePort_address), this);
                _stub.setPortName(getNativeStyleServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
881880
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.OfflineCallConversionFeedServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.OfflineCallConversionFeedServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.OfflineCallConversionFeedServiceSoapBindingStub(new java.net.URL(OfflineCallConversionFeedServiceInterfacePort_address), this);
                _stub.setPortName(getOfflineCallConversionFeedServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }