Bind the socket to the given local endpoint. * This function binds the socket to the specified endpoint on the local * machine. * * @param endpoint An endpoint on the local machine to which the socket will * be bound. * * @throws boost::system::system_error Thrown on failure. * * @par Example * @code * boost::asio::ip::tcp::socket socket(my_context); * socket.open(
| 788 | * @endcode |
| 789 | */ |
| 790 | void bind(const endpoint_type& endpoint) |
| 791 | { |
| 792 | boost::system::error_code ec; |
| 793 | impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); |
| 794 | boost::asio::detail::throw_error(ec, "bind"); |
| 795 | } |
| 796 | |
| 797 | /// Bind the socket to the given local endpoint. |
| 798 | /** |