       <span class="phrase"><a name="boost_asio.reference.basic_socket.local_endpoint.overload2.example"></a></span><a class="link" href="overload2.html#boost_asio.reference.basic_socket.local_endpoint.overload2.example">Example</a>
          </h6>
<pre class="programlisting">boost::asio::ip::tcp::socket socket(io_context);
...
boost::system::error_code ec;
boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
if (ec)
{
  // An error occurred.
}
</pre>
</div>
<table xmlns:rev="http://www.cs.r