org.apache.tomcat.jni.Address.getnameinfo()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(170)

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

Address.getnameinfo介绍

[英]Look up the host name from an apr_sockaddr_t.
[中]从apr\u sockaddr\t中查找主机名。

代码示例

代码示例来源:origin: codefollower/Tomcat-Research

  1. public String getLocalHostname() throws IOException {
  2. if (socket != 0 && context.running) {
  3. try {
  4. long sa = Address.get(Socket.APR_LOCAL, socket);
  5. return Address.getnameinfo(sa, 0);
  6. } catch (Exception ex) {
  7. throw new IOException(ex);
  8. }
  9. }
  10. throw new IOException("Socket closed");
  11. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. public String getRemoteHostname() throws IOException {
  2. if (socket != 0 && context.running) {
  3. try {
  4. long sa = Address.get(Socket.APR_REMOTE, socket);
  5. String remoteHost = Address.getnameinfo(sa, 0);
  6. if (remoteHost == null) {
  7. remoteHost = Address.getip(sa);
  8. }
  9. return remoteHost;
  10. } catch (Exception ex) {
  11. throw new IOException(ex);
  12. }
  13. }
  14. throw new IOException("Socket closed");
  15. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. @Override
  2. protected void populateLocalName() {
  3. if (closed) {
  4. return;
  5. }
  6. try {
  7. long socket = getSocket().longValue();
  8. long sa = Address.get(Socket.APR_LOCAL, socket);
  9. localName =Address.getnameinfo(sa, 0);
  10. } catch (Exception e) {
  11. log.warn(sm.getString("endpoint.warn.noLocalName"), e);
  12. }
  13. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. @Override
  2. protected void populateRemoteHost() {
  3. if (closed) {
  4. return;
  5. }
  6. try {
  7. long socket = getSocket().longValue();
  8. long sa = Address.get(Socket.APR_REMOTE, socket);
  9. remoteHost = Address.getnameinfo(sa, 0);
  10. if (remoteAddr == null) {
  11. remoteAddr = Address.getip(sa);
  12. }
  13. } catch (Exception e) {
  14. log.warn(sm.getString("endpoint.warn.noRemoteHost", getSocket()), e);
  15. }
  16. }

代码示例来源:origin: jboss.web/jbossweb

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socket);
  3. localName = Address.getnameinfo(sa, 0);
  4. } catch (Exception e) {
  5. log.warn(sm.getString("http11processor.socket.info"), e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socket);
  8. remoteHost = Address.getnameinfo(sa, 0);
  9. } catch (Exception e) {
  10. log.warn(sm.getString("http11processor.socket.info"), e);

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socketRef);
  3. localName = Address.getnameinfo(sa, 0);
  4. } catch (Exception e) {
  5. log.warn(sm.getString("http11processor.socket.info"), e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socketRef);
  8. remoteHost = Address.getnameinfo(sa, 0);
  9. if (remoteHost == null) {
  10. remoteHost = Address.getip(sa);

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socketRef);
  3. localName = Address.getnameinfo(sa, 0);
  4. } catch (Exception e) {
  5. log.warn(sm.getString("http11processor.socket.info"), e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socketRef);
  8. remoteHost = Address.getnameinfo(sa, 0);
  9. if (remoteHost == null) {
  10. remoteHost = Address.getip(sa);

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socketRef);
  3. localName = Address.getnameinfo(sa, 0);
  4. } catch (Exception e) {
  5. log.warn(sm.getString("http11processor.socket.info"), e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socketRef);
  8. remoteHost = Address.getnameinfo(sa, 0);
  9. if (remoteHost == null) {
  10. remoteHost = Address.getip(sa);

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socket);
  3. localName = Address.getnameinfo(sa, 0);
  4. } catch (Exception e) {
  5. log.warn(sm.getString("http11processor.socket.info"), e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socket);
  8. remoteHost = Address.getnameinfo(sa, 0);
  9. if (remoteHost == null) {
  10. remoteHost = Address.getip(sa);

代码示例来源:origin: codefollower/Tomcat-Research

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socketRef);
  3. socketWrapper.setLocalName(Address.getnameinfo(sa, 0));
  4. } catch (Exception e) {
  5. log.warn(sm.getString("http11processor.socket.info"), e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socketRef);
  8. socketWrapper.setRemoteHost(Address.getnameinfo(sa, 0));
  9. if (socketWrapper.getRemoteHost() == null) {
  10. if (socketWrapper.getRemoteAddr() == null) {

代码示例来源:origin: org.jboss.web/jbossweb

  1. try {
  2. long sa = Address.get(Socket.APR_LOCAL, socket);
  3. localName = Address.getnameinfo(sa, 0);
  4. } catch (Exception e) {
  5. CoyoteLogger.HTTP_LOGGER.errorGettingSocketInformation(e);
  6. try {
  7. long sa = Address.get(Socket.APR_REMOTE, socket);
  8. remoteHost = Address.getnameinfo(sa, 0);
  9. if (remoteHost == null) {
  10. remoteAddr = Address.getip(sa);

相关文章