org.glassfish.grizzly.Connection.getPeerAddress()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.glassfish.grizzly.Connection.getPeerAddress()方法的一些代码示例,展示了Connection.getPeerAddress()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connection.getPeerAddress()方法的具体详情如下:
包路径:org.glassfish.grizzly.Connection
类名称:Connection
方法名:getPeerAddress

Connection.getPeerAddress介绍

[英]Get the connection peer address
[中]

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public InetSocketAddress getRemoteAddress() {
  return (InetSocketAddress) connection.getPeerAddress();
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public InetSocketAddress getRemoteAddress() {
  return (InetSocketAddress) connection.getPeerAddress();
}

代码示例来源:origin: javaee/grizzly

@Override
  public Object evaluate() {
    return connection.getPeerAddress();
  }
});

代码示例来源:origin: javaee/grizzly

@Override
  public Object evaluate() {
    return connection.getPeerAddress();
  }
});

代码示例来源:origin: org.glassfish.grizzly/grizzly-http2

@Override
  public Object evaluate() {
    return connection.getPeerAddress();
  }
});

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

public static String getPeerHostName(final Connection<?> connection) {
    // try to get the peer's host name we try to connect to
    final Object addr = connection.getPeerAddress();
    return (addr instanceof InetSocketAddress)
        ? ((InetSocketAddress) addr).getHostString() : //supported in 1.7+
        null;
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * @return the Internet Protocol (IP) source port of the client or last
 *  proxy that sent the request.
 */
public int getRemotePort() {
  if (remotePort == -1) {
    remotePort = ((InetSocketAddress) connection.getPeerAddress()).getPort();
  }
  return remotePort;
}

代码示例来源:origin: javaee/grizzly

/**
 * @return the Internet Protocol (IP) source port of the client or last
 *  proxy that sent the request.
 */
public int getRemotePort() {
  if (remotePort == -1) {
    remotePort = ((InetSocketAddress) connection.getPeerAddress()).getPort();
  }
  return remotePort;
}

代码示例来源:origin: javaee/grizzly

public static String getPeerHostName(final Connection<?> connection) {
    // try to get the peer's host name we try to connect to
    final Object addr = connection.getPeerAddress();
    return (addr instanceof InetSocketAddress)
        ? ((InetSocketAddress) addr).getHostString() : //supported in 1.7+
        null;
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-core

public static String getPeerHostName(final Connection<?> connection) {
    // try to get the peer's host name we try to connect to
    final Object addr = connection.getPeerAddress();
    return (addr instanceof InetSocketAddress)
        ? ((InetSocketAddress) addr).getHostString() : //supported in 1.7+
        null;
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * @return the Internet Protocol (IP) source port of the client or last
 *  proxy that sent the request.
 */
public int getRemotePort() {
  if (remotePort == -1) {
    remotePort = ((InetSocketAddress) connection.getPeerAddress()).getPort();
  }
  return remotePort;
}

代码示例来源:origin: javaee/grizzly

public static String getPeerHostName(final Connection<?> connection) {
    // try to get the peer's host name we try to connect to
    final Object addr = connection.getPeerAddress();
    return (addr instanceof InetSocketAddress)
        ? ((InetSocketAddress) addr).getHostString() : //supported in 1.7+
        null;
  }
}

代码示例来源:origin: javaee/grizzly

public static String getPeerHostName(final Connection<?> connection) {
    // try to get the peer's host name we try to connect to
    final Object addr = connection.getPeerAddress();
    return (addr instanceof InetSocketAddress)
        ? ((InetSocketAddress) addr).getHostString() : //supported in 1.7+
        null;
  }
}

代码示例来源:origin: javaee/grizzly

public static String getPeerHostName(final Connection<?> connection) {
    // try to get the peer's host name we try to connect to
    final Object addr = connection.getPeerAddress();
    return (addr instanceof InetSocketAddress)
        ? ((InetSocketAddress) addr).getHostString() : //supported in 1.7+
        null;
  }
}

代码示例来源:origin: org.glassfish.main.core/kernel

@Override
public void onConnectEvent(final Connection connection) {
  grizzlyMonitoring.getConnectionQueueProbeProvider().connectionConnectedEvent(
      monitoringId, connection.hashCode(),
      connection.getPeerAddress().toString());
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * @return the {@link DataChunk} representing the Internet Protocol (IP)
 *  address of the client or last proxy that sent the request.
 */
public DataChunk remoteAddr() {
  if (remoteAddressC.isNull()) {
    remoteAddressC
       .setString(((InetSocketAddress) connection.getPeerAddress())
          .getAddress().getHostAddress());
  }
  return remoteAddressC;
}

代码示例来源:origin: javaee/grizzly

/**
 * @return the {@link DataChunk} representing the Internet Protocol (IP)
 *  address of the client or last proxy that sent the request.
 */
public DataChunk remoteAddr() {
  if (remoteAddressC.isNull()) {
    remoteAddressC
       .setString(((InetSocketAddress) connection.getPeerAddress())
          .getAddress().getHostAddress());
  }
  return remoteAddressC;
}

代码示例来源:origin: javaee/grizzly

/**
 * @return the {@link DataChunk} representing the Internet Protocol (IP)
 *  address of the client or last proxy that sent the request.
 */
public DataChunk remoteAddr() {
  if (remoteAddressC.isNull()) {
    remoteAddressC
       .setString(((InetSocketAddress) connection.getPeerAddress())
          .getAddress().getHostAddress());
  }
  return remoteAddressC;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * @return the {@link DataChunk} representing the Internet Protocol (IP)
 *  address of the client or last proxy that sent the request.
 */
public DataChunk remoteAddr() {
  if (remoteAddressC.isNull()) {
    remoteAddressC
       .setString(((InetSocketAddress) connection.getPeerAddress())
          .getAddress().getHostAddress());
  }
  return remoteAddressC;
}

代码示例来源:origin: org.mule.services/mule-service-http

private DefaultHttpRequestContext createRequestContext(FilterChainContext ctx, String scheme,
                            GrizzlyHttpRequestAdapter httpRequest) {
 DefaultClientConnection clientConnection;
 SSLSession sslSession = (SSLSession) ctx.getAttributes().getAttribute(SSL_SESSION_ATTRIBUTE_KEY);
 if (sslSession != null) {
  clientConnection = new DefaultClientConnection(sslSession, (InetSocketAddress) ctx.getConnection().getPeerAddress());
 } else {
  clientConnection = new DefaultClientConnection((InetSocketAddress) ctx.getConnection().getPeerAddress());
 }
 ServerConnection serverConnection = new DefaultServerConnection((InetSocketAddress) ctx.getConnection().getLocalAddress());
 return new DefaultHttpRequestContext(scheme, httpRequest, clientConnection, serverConnection);
}

相关文章

微信公众号

最新文章

更多