explicit basic_socket_acceptor(const executor_type& ex) 和 template <typename ExecutionContext> |
创建&未打开acceptor(未打开的含义是,不能进行监听接受新的连接) |
basic_socket_acceptor(const executor_type& ex, const protocol_type& protocol) 和 template <typename ExecutionContext> |
创建&打开acceptor |
basic_socket_acceptor(const executor_type& ex, 和 template <typename ExecutionContext> |
创建&打开&监听指定的endpoint |
basic_socket_acceptor(const executor_type& ex, 和 template <typename ExecutionContext> |
对原生socket创建acceptor |
basic_socket_acceptor(basic_socket_acceptor&& other) 和 basic_socket_acceptor& operator=(basic_socket_acceptor&& other) 和 template <typename Protocol1, typename Executor1> 和 template <typename Protocol1, typename Executor1> |
支持移动构造函数时,可用 |
executor_type get_executor() | 获取执行器 |
void open(const protocol_type& protocol = protocol_type()) 和 BOOST_ASIO_SYNC_OP_VOID open(const protocol_type& protocol, |
打开指定的协议的acceptor |
void assign(const protocol_type& protocol, 和 BOOST_ASIO_SYNC_OP_VOID assign(const protocol_type& protocol, |
原生acceptor创建acceptor socket |
bool is_open() | 确定acceptor socket是否打开 |
void bind(const endpoint_type& endpoint) 和 BOOST_ASIO_SYNC_OP_VOID bind(const endpoint_type& endpoint, |
绑定acceptor到指定的local endpoint |
void listen(int backlog = socket_base::max_listen_connections) 和 BOOST_ASIO_SYNC_OP_VOID listen(int backlog, boost::system::error_code& ec) |
阻塞式监听 |
void close() 和 BOOST_ASIO_SYNC_OP_VOID close(boost::system::error_code& ec) |
关闭acceptor socket |
native_handle_type release() 和 native_handle_type release(boost::system::error_code& ec) |
释放对原生acceptor的控制 |
native_handle_type native_handle() | 获取原生acceptor |
void cancel() 和 BOOST_ASIO_SYNC_OP_VOID cancel(boost::system::error_code& ec) |
取消异步操作 |
boost::asio 序列18:basic_socket_acceptor
最新推荐文章于 2024-04-05 15:55:43 发布