Assign an existing native socket to the socket. * This function opens the socket to hold an existing native socket. * * @param protocol An object specifying which protocol is to be used. * * @param native_socket A native socket. * * @throws asio::system_error Thrown on failure. */
| 466 | * @throws asio::system_error Thrown on failure. |
| 467 | */ |
| 468 | void assign(const protocol_type& protocol, |
| 469 | const native_handle_type& native_socket) |
| 470 | { |
| 471 | asio::error_code ec; |
| 472 | impl_.get_service().assign(impl_.get_implementation(), |
| 473 | protocol, native_socket, ec); |
| 474 | asio::detail::throw_error(ec, "assign"); |
| 475 | } |
| 476 | |
| 477 | /// Assign an existing native socket to the socket. |
| 478 | /* |
nothing calls this directly
no test coverage detected