最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

chilkat Get Client IP from ssh socket - Stack Overflow

programmeradmin5浏览0评论

I'm using ssh class from chilkat to establish an ssh connection. Now i'd like to get the ip address of the underlying transport socket. The function get_ClientIpAddress return always an empty string.

CkSsh myssh;
CkString ip;

myssh.Connect(GetHostName(), 22);
myssh.get_ClientIpAddress(ip);

In the logfile the IP-address is shown:

...
 connectInner(47ms):
      hostname: server
      port: 22
      preferRsaHostKeyAlgorithm: 1
      sshConnect(16ms):
        connectSocket(16ms):
          domainOrIpAddress: server
          port: 22
          connectTimeoutMs: 30000
          connect_ipv6_or_ipv4(16ms):
            Multi-threaded domain to IP address resolution
            resolveHostname6:
              maxTimeMs: 30000
            --resolveHostname6
            connecting to IPV4 address...
            ipAddress: 172.16.10.179
            createSocket:
              Setting SO_SNDBUF size
              sendBufSize: 262144
              Setting SO_RCVBUF size
              recvBufSize: 4194304
            --createSocket
            connect(16ms):
              Waiting for the connect to complete...
              connectTimeoutMs: 30000
              myIP: 172.16.9.9
              myPort: 51375
              socket connect successful.
            --connect
          --connect_ipv6_or_ipv4
        --connectSocket
发布评论

评论列表(0)

  1. 暂无评论