Open the socket using the specified protocol. * This function opens the socket so that it will use the specified protocol. * * @param protocol An object specifying protocol parameters to be used. * * @throws boost::system::system_error Thrown on failure. * * @par Example * @code * boost::asio::ip::tcp::socket socket(io_service); * socket.open(boost::asio::ip::tcp::v4());
| 265 | * @endcode |
| 266 | */ |
| 267 | void open(const protocol_type& protocol = protocol_type()) |
| 268 | { |
| 269 | boost::system::error_code ec; |
| 270 | this->get_service().open(this->get_implementation(), protocol, ec); |
| 271 | boost::asio::detail::throw_error(ec, "open"); |
| 272 | } |
| 273 | |
| 274 | /// Open the socket using the specified protocol. |
| 275 | /** |
no test coverage detected