升压ASIO插座:如何让自己的IP,端口ADRESS? [英] Boost asio socket: how to get your own IP, port adress?

查看:90
本文介绍了升压ASIO插座:如何让自己的IP,端口ADRESS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用升压ASIO TCP服务器。我已经接受了套接字连接。因为它是由我的用户的服务器目前正与交流了如何获取IP,我的服务器计算机的端口?

I have a TCP server using boost asio. I have accepted a socket connection. How to get IP, Port of my server machine as it is seen by my user server is currently communicating with?

推荐答案

我相信这是<一个href=\"http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/reference/basic_stream_socket/local_endpoint.html\"相对=nofollow> basic_stream_socket :: local_endpoint() ,但是这并不一定另一端看到的,如果你是落后一个 NAT网关

I believe it's basic_stream_socket::local_endpoint(), but that's not necessarily what the other end sees if you are behind a NAT gateway.

这篇关于升压ASIO插座:如何让自己的IP,端口ADRESS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆