3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>local::stream_protocol::acceptor</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../local__stream_protocol.html" title="local::stream_protocol">
9 <link rel="prev" href="../local__stream_protocol.html" title="local::stream_protocol">
10 <link rel="next" href="endpoint.html" title="local::stream_protocol::endpoint">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../local__stream_protocol.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../local__stream_protocol.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="endpoint.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_asio.reference.local__stream_protocol.acceptor"></a><a class="link" href="acceptor.html" title="local::stream_protocol::acceptor">local::stream_protocol::acceptor</a>
28 </h4></div></div></div>
30 <a class="indexterm" name="boost_asio.indexterm.local__stream_protocol.acceptor"></a>
32 UNIX domain acceptor type.
34 <pre class="programlisting">typedef basic_socket_acceptor< stream_protocol > acceptor;
37 <a name="boost_asio.reference.local__stream_protocol.acceptor.h0"></a>
38 <span class="phrase"><a name="boost_asio.reference.local__stream_protocol.acceptor.types"></a></span><a class="link" href="acceptor.html#boost_asio.reference.local__stream_protocol.acceptor.types">Types</a>
40 <div class="informaltable"><table class="table">
61 <a class="link" href="../basic_socket_acceptor__rebind_executor.html" title="basic_socket_acceptor::rebind_executor"><span class="bold"><strong>rebind_executor</strong></span></a>
66 Rebinds the acceptor type to another executor.
73 <a class="link" href="../basic_socket_acceptor/broadcast.html" title="basic_socket_acceptor::broadcast"><span class="bold"><strong>broadcast</strong></span></a>
78 Socket option to permit sending of broadcast messages.
85 <a class="link" href="../basic_socket_acceptor/bytes_readable.html" title="basic_socket_acceptor::bytes_readable"><span class="bold"><strong>bytes_readable</strong></span></a>
90 IO control command to get the amount of data that can be read
98 <a class="link" href="../basic_socket_acceptor/debug.html" title="basic_socket_acceptor::debug"><span class="bold"><strong>debug</strong></span></a>
103 Socket option to enable socket-level debugging.
110 <a class="link" href="../basic_socket_acceptor/do_not_route.html" title="basic_socket_acceptor::do_not_route"><span class="bold"><strong>do_not_route</strong></span></a>
115 Socket option to prevent routing, use local interfaces only.
122 <a class="link" href="../basic_socket_acceptor/enable_connection_aborted.html" title="basic_socket_acceptor::enable_connection_aborted"><span class="bold"><strong>enable_connection_aborted</strong></span></a>
127 Socket option to report aborted connections on accept.
134 <a class="link" href="../basic_socket_acceptor/endpoint_type.html" title="basic_socket_acceptor::endpoint_type"><span class="bold"><strong>endpoint_type</strong></span></a>
146 <a class="link" href="../basic_socket_acceptor/executor_type.html" title="basic_socket_acceptor::executor_type"><span class="bold"><strong>executor_type</strong></span></a>
151 The type of the executor associated with the object.
158 <a class="link" href="../basic_socket_acceptor/keep_alive.html" title="basic_socket_acceptor::keep_alive"><span class="bold"><strong>keep_alive</strong></span></a>
163 Socket option to send keep-alives.
170 <a class="link" href="../basic_socket_acceptor/linger.html" title="basic_socket_acceptor::linger"><span class="bold"><strong>linger</strong></span></a>
175 Socket option to specify whether the socket lingers on close
176 if unsent data is present.
183 <a class="link" href="../basic_socket_acceptor/message_flags.html" title="basic_socket_acceptor::message_flags"><span class="bold"><strong>message_flags</strong></span></a>
188 Bitmask type for flags that can be passed to send and receive
196 <a class="link" href="../basic_socket_acceptor/native_handle_type.html" title="basic_socket_acceptor::native_handle_type"><span class="bold"><strong>native_handle_type</strong></span></a>
201 The native representation of an acceptor.
208 <a class="link" href="../basic_socket_acceptor/out_of_band_inline.html" title="basic_socket_acceptor::out_of_band_inline"><span class="bold"><strong>out_of_band_inline</strong></span></a>
213 Socket option for putting received out-of-band data inline.
220 <a class="link" href="../basic_socket_acceptor/protocol_type.html" title="basic_socket_acceptor::protocol_type"><span class="bold"><strong>protocol_type</strong></span></a>
232 <a class="link" href="../basic_socket_acceptor/receive_buffer_size.html" title="basic_socket_acceptor::receive_buffer_size"><span class="bold"><strong>receive_buffer_size</strong></span></a>
237 Socket option for the receive buffer size of a socket.
244 <a class="link" href="../basic_socket_acceptor/receive_low_watermark.html" title="basic_socket_acceptor::receive_low_watermark"><span class="bold"><strong>receive_low_watermark</strong></span></a>
249 Socket option for the receive low watermark.
256 <a class="link" href="../basic_socket_acceptor/reuse_address.html" title="basic_socket_acceptor::reuse_address"><span class="bold"><strong>reuse_address</strong></span></a>
261 Socket option to allow the socket to be bound to an address that
269 <a class="link" href="../basic_socket_acceptor/send_buffer_size.html" title="basic_socket_acceptor::send_buffer_size"><span class="bold"><strong>send_buffer_size</strong></span></a>
274 Socket option for the send buffer size of a socket.
281 <a class="link" href="../basic_socket_acceptor/send_low_watermark.html" title="basic_socket_acceptor::send_low_watermark"><span class="bold"><strong>send_low_watermark</strong></span></a>
286 Socket option for the send low watermark.
293 <a class="link" href="../basic_socket_acceptor/shutdown_type.html" title="basic_socket_acceptor::shutdown_type"><span class="bold"><strong>shutdown_type</strong></span></a>
298 Different ways a socket may be shutdown.
305 <a class="link" href="../basic_socket_acceptor/wait_type.html" title="basic_socket_acceptor::wait_type"><span class="bold"><strong>wait_type</strong></span></a>
317 <a name="boost_asio.reference.local__stream_protocol.acceptor.h1"></a>
318 <span class="phrase"><a name="boost_asio.reference.local__stream_protocol.acceptor.member_functions"></a></span><a class="link" href="acceptor.html#boost_asio.reference.local__stream_protocol.acceptor.member_functions">Member
321 <div class="informaltable"><table class="table">
342 <a class="link" href="../basic_socket_acceptor/accept.html" title="basic_socket_acceptor::accept"><span class="bold"><strong>accept</strong></span></a>
347 Accept a new connection. <br> <span class="silver"> —</span><br> Accept a new connection
348 and obtain the endpoint of the peer.
355 <a class="link" href="../basic_socket_acceptor/assign.html" title="basic_socket_acceptor::assign"><span class="bold"><strong>assign</strong></span></a>
360 Assigns an existing native acceptor to the acceptor.
367 <a class="link" href="../basic_socket_acceptor/async_accept.html" title="basic_socket_acceptor::async_accept"><span class="bold"><strong>async_accept</strong></span></a>
372 Start an asynchronous accept.
379 <a class="link" href="../basic_socket_acceptor/async_wait.html" title="basic_socket_acceptor::async_wait"><span class="bold"><strong>async_wait</strong></span></a>
384 Asynchronously wait for the acceptor to become ready to read,
385 ready to write, or to have pending error conditions.
392 <a class="link" href="../basic_socket_acceptor/basic_socket_acceptor.html" title="basic_socket_acceptor::basic_socket_acceptor"><span class="bold"><strong>basic_socket_acceptor</strong></span></a>
397 Construct an acceptor without opening it. <br> <span class="silver"> —</span><br> Construct
398 an open acceptor. <br> <span class="silver"> —</span><br> Construct an acceptor opened
399 on the given endpoint. <br> <span class="silver"> —</span><br> Construct a basic_socket_acceptor
400 on an existing native acceptor. <br> <span class="silver"> —</span><br> Move-construct
401 a basic_socket_acceptor from another. <br> <span class="silver"> —</span><br> Move-construct
402 a basic_socket_acceptor from an acceptor of another protocol
410 <a class="link" href="../basic_socket_acceptor/bind.html" title="basic_socket_acceptor::bind"><span class="bold"><strong>bind</strong></span></a>
415 Bind the acceptor to the given local endpoint.
422 <a class="link" href="../basic_socket_acceptor/cancel.html" title="basic_socket_acceptor::cancel"><span class="bold"><strong>cancel</strong></span></a>
427 Cancel all asynchronous operations associated with the acceptor.
434 <a class="link" href="../basic_socket_acceptor/close.html" title="basic_socket_acceptor::close"><span class="bold"><strong>close</strong></span></a>
446 <a class="link" href="../basic_socket_acceptor/get_executor.html" title="basic_socket_acceptor::get_executor"><span class="bold"><strong>get_executor</strong></span></a>
451 Get the executor associated with the object.
458 <a class="link" href="../basic_socket_acceptor/get_option.html" title="basic_socket_acceptor::get_option"><span class="bold"><strong>get_option</strong></span></a>
463 Get an option from the acceptor.
470 <a class="link" href="../basic_socket_acceptor/io_control.html" title="basic_socket_acceptor::io_control"><span class="bold"><strong>io_control</strong></span></a>
475 Perform an IO control command on the acceptor.
482 <a class="link" href="../basic_socket_acceptor/is_open.html" title="basic_socket_acceptor::is_open"><span class="bold"><strong>is_open</strong></span></a>
487 Determine whether the acceptor is open.
494 <a class="link" href="../basic_socket_acceptor/listen.html" title="basic_socket_acceptor::listen"><span class="bold"><strong>listen</strong></span></a>
499 Place the acceptor into the state where it will listen for new
507 <a class="link" href="../basic_socket_acceptor/local_endpoint.html" title="basic_socket_acceptor::local_endpoint"><span class="bold"><strong>local_endpoint</strong></span></a>
512 Get the local endpoint of the acceptor.
519 <a class="link" href="../basic_socket_acceptor/native_handle.html" title="basic_socket_acceptor::native_handle"><span class="bold"><strong>native_handle</strong></span></a>
524 Get the native acceptor representation.
531 <a class="link" href="../basic_socket_acceptor/native_non_blocking.html" title="basic_socket_acceptor::native_non_blocking"><span class="bold"><strong>native_non_blocking</strong></span></a>
536 Gets the non-blocking mode of the native acceptor implementation.
537 <br> <span class="silver"> —</span><br> Sets the non-blocking mode of the native acceptor
545 <a class="link" href="../basic_socket_acceptor/non_blocking.html" title="basic_socket_acceptor::non_blocking"><span class="bold"><strong>non_blocking</strong></span></a>
550 Gets the non-blocking mode of the acceptor. <br> <span class="silver"> —</span><br> Sets
551 the non-blocking mode of the acceptor.
558 <a class="link" href="../basic_socket_acceptor/open.html" title="basic_socket_acceptor::open"><span class="bold"><strong>open</strong></span></a>
563 Open the acceptor using the specified protocol.
570 <a class="link" href="../basic_socket_acceptor/operator_eq_.html" title="basic_socket_acceptor::operator="><span class="bold"><strong>operator=</strong></span></a>
575 Move-assign a basic_socket_acceptor from another. <br> <span class="silver"> —</span><br>
576 Move-assign a basic_socket_acceptor from an acceptor of another
584 <a class="link" href="../basic_socket_acceptor/release.html" title="basic_socket_acceptor::release"><span class="bold"><strong>release</strong></span></a>
589 Release ownership of the underlying native acceptor.
596 <a class="link" href="../basic_socket_acceptor/set_option.html" title="basic_socket_acceptor::set_option"><span class="bold"><strong>set_option</strong></span></a>
601 Set an option on the acceptor.
608 <a class="link" href="../basic_socket_acceptor/wait.html" title="basic_socket_acceptor::wait"><span class="bold"><strong>wait</strong></span></a>
613 Wait for the acceptor to become ready to read, ready to write,
614 or to have pending error conditions.
621 <a class="link" href="../basic_socket_acceptor/_basic_socket_acceptor.html" title="basic_socket_acceptor::~basic_socket_acceptor"><span class="bold"><strong>~basic_socket_acceptor</strong></span></a>
626 Destroys the acceptor.
633 <a name="boost_asio.reference.local__stream_protocol.acceptor.h2"></a>
634 <span class="phrase"><a name="boost_asio.reference.local__stream_protocol.acceptor.data_members"></a></span><a class="link" href="acceptor.html#boost_asio.reference.local__stream_protocol.acceptor.data_members">Data
637 <div class="informaltable"><table class="table">
658 <a class="link" href="../basic_socket_acceptor/max_connections.html" title="basic_socket_acceptor::max_connections"><span class="bold"><strong>max_connections</strong></span></a>
663 (Deprecated: Use max_listen_connections.) The maximum length
664 of the queue of pending incoming connections.
671 <a class="link" href="../basic_socket_acceptor/max_listen_connections.html" title="basic_socket_acceptor::max_listen_connections"><span class="bold"><strong>max_listen_connections</strong></span></a>
676 The maximum length of the queue of pending incoming connections.
683 <a class="link" href="../basic_socket_acceptor/message_do_not_route.html" title="basic_socket_acceptor::message_do_not_route"><span class="bold"><strong>message_do_not_route</strong></span></a>
688 Specify that the data should not be subject to routing.
695 <a class="link" href="../basic_socket_acceptor/message_end_of_record.html" title="basic_socket_acceptor::message_end_of_record"><span class="bold"><strong>message_end_of_record</strong></span></a>
700 Specifies that the data marks the end of a record.
707 <a class="link" href="../basic_socket_acceptor/message_out_of_band.html" title="basic_socket_acceptor::message_out_of_band"><span class="bold"><strong>message_out_of_band</strong></span></a>
712 Process out-of-band data.
719 <a class="link" href="../basic_socket_acceptor/message_peek.html" title="basic_socket_acceptor::message_peek"><span class="bold"><strong>message_peek</strong></span></a>
724 Peek at incoming data without removing it from the input queue.
731 The <a class="link" href="../basic_socket_acceptor.html" title="basic_socket_acceptor"><code class="computeroutput">basic_socket_acceptor</code></a>
732 class template is used for accepting new socket connections.
735 <a name="boost_asio.reference.local__stream_protocol.acceptor.h3"></a>
736 <span class="phrase"><a name="boost_asio.reference.local__stream_protocol.acceptor.thread_safety"></a></span><a class="link" href="acceptor.html#boost_asio.reference.local__stream_protocol.acceptor.thread_safety">Thread
740 <span class="emphasis"><em>Distinct</em></span> <span class="emphasis"><em>objects:</em></span> Safe.
743 <span class="emphasis"><em>Shared</em></span> <span class="emphasis"><em>objects:</em></span> Unsafe.
746 <a name="boost_asio.reference.local__stream_protocol.acceptor.h4"></a>
747 <span class="phrase"><a name="boost_asio.reference.local__stream_protocol.acceptor.example"></a></span><a class="link" href="acceptor.html#boost_asio.reference.local__stream_protocol.acceptor.example">Example</a>
750 Opening a socket acceptor with the SO_REUSEADDR option enabled:
752 <pre class="programlisting">boost::asio::ip::tcp::acceptor acceptor(my_context);
753 boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
754 acceptor.open(endpoint.protocol());
755 acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
756 acceptor.bind(endpoint);
760 <a name="boost_asio.reference.local__stream_protocol.acceptor.h5"></a>
761 <span class="phrase"><a name="boost_asio.reference.local__stream_protocol.acceptor.requirements"></a></span><a class="link" href="acceptor.html#boost_asio.reference.local__stream_protocol.acceptor.requirements">Requirements</a>
764 <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/local/stream_protocol.hpp</code>
767 <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio.hpp</code>
770 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
771 <td align="left"></td>
772 <td align="right"><div class="copyright-footer">Copyright © 2003-2019 Christopher M. Kohlhoff<p>
773 Distributed under the Boost Software License, Version 1.0. (See accompanying
774 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
779 <div class="spirit-nav">
780 <a accesskey="p" href="../local__stream_protocol.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../local__stream_protocol.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="endpoint.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>