Boost C++ 库

...世界上最受推崇和设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码规范

basic_stream_socket::local_endpoint (2 个重载中的 1 个) - Boost C++ 函数库
PrevUpHomeNext

继承自 basic_socket。

获取套接字的本地端点。

endpoint_type local_endpoint() const;

此函数用于获取套接字的本地绑定端点。

返回值

表示套接字本地端点的对象。

异常

boost::system::system_error

失败时抛出。

示例
boost::asio::ip::tcp::socket socket(my_context);
...
boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();

PrevUpHomeNext