Realistic 3D camera system
3D camera system components
|
Provides the ability to accept new connections. More...
#include <basic_socket_acceptor.hpp>
Public Types | |
typedef SocketAcceptorService::native_handle_type | native_type |
typedef SocketAcceptorService::native_handle_type | native_handle_type |
The native representation of an acceptor. More... | |
typedef Protocol | protocol_type |
The protocol type. More... | |
typedef Protocol::endpoint | endpoint_type |
The endpoint type. More... | |
Public Types inherited from asio::basic_io_object< SocketAcceptorService > | |
typedef SocketAcceptorService | service_type |
The type of the service that will be used to provide I/O operations. More... | |
typedef service_type::implementation_type | implementation_type |
The underlying implementation type of I/O object. More... | |
Public Types inherited from asio::socket_base | |
enum | shutdown_type { shutdown_receive = ASIO_OS_DEF(SHUT_RD), shutdown_send = ASIO_OS_DEF(SHUT_WR), shutdown_both = ASIO_OS_DEF(SHUT_RDWR) } |
Different ways a socket may be shutdown. More... | |
typedef int | message_flags |
Bitmask type for flags that can be passed to send and receive operations. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_BROADCAST)> | broadcast |
Socket option to permit sending of broadcast messages. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_DEBUG)> | debug |
Socket option to enable socket-level debugging. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_DONTROUTE)> | do_not_route |
Socket option to prevent routing, use local interfaces only. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_KEEPALIVE)> | keep_alive |
Socket option to send keep-alives. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_SNDBUF)> | send_buffer_size |
Socket option for the send buffer size of a socket. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_SNDLOWAT)> | send_low_watermark |
Socket option for the send low watermark. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_RCVBUF)> | receive_buffer_size |
Socket option for the receive buffer size of a socket. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_RCVLOWAT)> | receive_low_watermark |
Socket option for the receive low watermark. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_REUSEADDR)> | reuse_address |
typedef asio::detail::socket_option::linger< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_LINGER)> | linger |
typedef asio::detail::socket_option::boolean< asio::detail::custom_socket_option_level, asio::detail::enable_connection_aborted_option > | enable_connection_aborted |
Socket option to report aborted connections on accept. More... | |
typedef asio::detail::io_control::non_blocking_io | non_blocking_io |
typedef asio::detail::io_control::bytes_readable | bytes_readable |
Public Member Functions | |
basic_socket_acceptor (asio::io_service &io_service) | |
Construct an acceptor without opening it. More... | |
basic_socket_acceptor (asio::io_service &io_service, const protocol_type &protocol) | |
Construct an open acceptor. More... | |
basic_socket_acceptor (asio::io_service &io_service, const endpoint_type &endpoint, bool reuse_addr=true) | |
Construct an acceptor opened on the given endpoint. More... | |
basic_socket_acceptor (asio::io_service &io_service, const protocol_type &protocol, const native_handle_type &native_acceptor) | |
Construct a basic_socket_acceptor on an existing native acceptor. More... | |
void | open (const protocol_type &protocol=protocol_type()) |
Open the acceptor using the specified protocol. More... | |
asio::error_code | open (const protocol_type &protocol, asio::error_code &ec) |
Open the acceptor using the specified protocol. More... | |
void | assign (const protocol_type &protocol, const native_handle_type &native_acceptor) |
Assigns an existing native acceptor to the acceptor. More... | |
asio::error_code | assign (const protocol_type &protocol, const native_handle_type &native_acceptor, asio::error_code &ec) |
Assigns an existing native acceptor to the acceptor. More... | |
bool | is_open () const |
Determine whether the acceptor is open. More... | |
void | bind (const endpoint_type &endpoint) |
Bind the acceptor to the given local endpoint. More... | |
asio::error_code | bind (const endpoint_type &endpoint, asio::error_code &ec) |
Bind the acceptor to the given local endpoint. More... | |
void | listen (int backlog=socket_base::max_connections) |
asio::error_code | listen (int backlog, asio::error_code &ec) |
void | close () |
Close the acceptor. More... | |
asio::error_code | close (asio::error_code &ec) |
Close the acceptor. More... | |
native_type | native () |
(Deprecated: Use native_handle().) Get the native acceptor representation. More... | |
native_handle_type | native_handle () |
Get the native acceptor representation. More... | |
void | cancel () |
Cancel all asynchronous operations associated with the acceptor. More... | |
asio::error_code | cancel (asio::error_code &ec) |
Cancel all asynchronous operations associated with the acceptor. More... | |
template<typename SettableSocketOption > | |
void | set_option (const SettableSocketOption &option) |
Set an option on the acceptor. More... | |
template<typename SettableSocketOption > | |
asio::error_code | set_option (const SettableSocketOption &option, asio::error_code &ec) |
Set an option on the acceptor. More... | |
template<typename GettableSocketOption > | |
void | get_option (GettableSocketOption &option) |
Get an option from the acceptor. More... | |
template<typename GettableSocketOption > | |
asio::error_code | get_option (GettableSocketOption &option, asio::error_code &ec) |
Get an option from the acceptor. More... | |
template<typename IoControlCommand > | |
void | io_control (IoControlCommand &command) |
Perform an IO control command on the acceptor. More... | |
template<typename IoControlCommand > | |
asio::error_code | io_control (IoControlCommand &command, asio::error_code &ec) |
Perform an IO control command on the acceptor. More... | |
bool | non_blocking () const |
Gets the non-blocking mode of the acceptor. More... | |
void | non_blocking (bool mode) |
Sets the non-blocking mode of the acceptor. More... | |
asio::error_code | non_blocking (bool mode, asio::error_code &ec) |
Sets the non-blocking mode of the acceptor. More... | |
bool | native_non_blocking () const |
Gets the non-blocking mode of the native acceptor implementation. More... | |
void | native_non_blocking (bool mode) |
Sets the non-blocking mode of the native acceptor implementation. More... | |
asio::error_code | native_non_blocking (bool mode, asio::error_code &ec) |
Sets the non-blocking mode of the native acceptor implementation. More... | |
endpoint_type | local_endpoint () const |
Get the local endpoint of the acceptor. More... | |
endpoint_type | local_endpoint (asio::error_code &ec) const |
Get the local endpoint of the acceptor. More... | |
template<typename Protocol1 , typename SocketService > | |
void | accept (basic_socket< Protocol1, SocketService > &peer, typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *=0) |
Accept a new connection. More... | |
template<typename Protocol1 , typename SocketService > | |
asio::error_code | accept (basic_socket< Protocol1, SocketService > &peer, asio::error_code &ec, typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *=0) |
Accept a new connection. More... | |
template<typename Protocol1 , typename SocketService , typename AcceptHandler > | |
ASIO_INITFN_RESULT_TYPE (AcceptHandler, void(asio::error_code)) async_accept(basic_socket< Protocol1 | |
Start an asynchronous accept. More... | |
SocketService | ASIO_MOVE_ARG (AcceptHandler) handler |
SocketService enable_if< is_convertible< Protocol, Protocol1 >::value >::type AcceptHandler | ASIO_INITFN_RESULT_TYPE (AcceptHandler, void(asio::error_code)) async_accept(basic_socket< protocol_type |
SocketService enable_if< is_convertible< Protocol, Protocol1 >::value >::type AcceptHandler SocketService endpoint_type | ASIO_MOVE_ARG (AcceptHandler) handler) |
Public Member Functions inherited from asio::basic_io_object< SocketAcceptorService > | |
asio::io_service & | get_io_service () |
Get the io_service associated with the object. More... | |
Public Member Functions inherited from asio::socket_base | |
ASIO_STATIC_CONSTANT (int, message_peek=ASIO_OS_DEF(MSG_PEEK)) | |
ASIO_STATIC_CONSTANT (int, message_out_of_band=ASIO_OS_DEF(MSG_OOB)) | |
ASIO_STATIC_CONSTANT (int, message_do_not_route=ASIO_OS_DEF(MSG_DONTROUTE)) | |
ASIO_STATIC_CONSTANT (int, message_end_of_record=ASIO_OS_DEF(MSG_EOR)) | |
ASIO_STATIC_CONSTANT (int, max_connections=ASIO_OS_DEF(SOMAXCONN)) | |
The maximum length of the queue of pending incoming connections. More... | |
Public Attributes | |
SocketService & | peer |
SocketService enable_if< is_convertible< Protocol, Protocol1 >::value >::type AcceptHandler SocketService & | peer |
SocketService enable_if< is_convertible< Protocol, Protocol1 >::value >::type AcceptHandler SocketService endpoint_type & | peer_endpoint |
Additional Inherited Members | |
Protected Member Functions inherited from asio::basic_io_object< SocketAcceptorService > | |
basic_io_object (asio::io_service &io_service) | |
Construct a basic_io_object. More... | |
~basic_io_object () | |
Protected destructor to prevent deletion through this type. More... | |
service_type & | get_service () |
Get the service associated with the I/O object. More... | |
const service_type & | get_service () const |
Get the service associated with the I/O object. More... | |
implementation_type & | get_implementation () |
Get the underlying implementation of the I/O object. More... | |
const implementation_type & | get_implementation () const |
Get the underlying implementation of the I/O object. More... | |
Protected Member Functions inherited from asio::socket_base | |
~socket_base () | |
Protected destructor to prevent deletion through this type. More... | |
Protected Attributes inherited from asio::basic_io_object< SocketAcceptorService > | |
service_type & | service |
implementation_type | implementation |
Provides the ability to accept new connections.
The basic_socket_acceptor class template is used for accepting new socket connections.
Definition at line 54 of file basic_socket_acceptor.hpp.
typedef Protocol::endpoint asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::endpoint_type |
The endpoint type.
Definition at line 70 of file basic_socket_acceptor.hpp.
typedef SocketAcceptorService::native_handle_type asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::native_handle_type |
The native representation of an acceptor.
Definition at line 64 of file basic_socket_acceptor.hpp.
typedef SocketAcceptorService::native_handle_type asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::native_type |
(Deprecated: Use native_handle_type.) The native representation of an acceptor.
Definition at line 61 of file basic_socket_acceptor.hpp.
typedef Protocol asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::protocol_type |
The protocol type.
Definition at line 67 of file basic_socket_acceptor.hpp.
|
inlineexplicit |
Construct an acceptor without opening it.
This constructor creates an acceptor without opening it to listen for new connections. The open() function must be called before the acceptor can accept new socket connections.
io_service | The io_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. |
Definition at line 82 of file basic_socket_acceptor.hpp.
|
inline |
Construct an open acceptor.
This constructor creates an acceptor and automatically opens it.
io_service | The io_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. |
protocol | An object specifying protocol parameters to be used. |
asio::system_error | Thrown on failure. |
Definition at line 99 of file basic_socket_acceptor.hpp.
|
inline |
Construct an acceptor opened on the given endpoint.
This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
io_service | The io_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. |
endpoint | An endpoint on the local machine on which the acceptor will listen for new connections. |
reuse_addr | Whether the constructor should set the socket option socket_base::reuse_address. |
asio::system_error | Thrown on failure. |
Definition at line 135 of file basic_socket_acceptor.hpp.
|
inline |
Construct a basic_socket_acceptor on an existing native acceptor.
This constructor creates an acceptor object to hold an existing native acceptor.
io_service | The io_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. |
protocol | An object specifying protocol parameters to be used. |
native_acceptor | A native acceptor. |
asio::system_error | Thrown on failure. |
Definition at line 171 of file basic_socket_acceptor.hpp.
|
inline |
Accept a new connection.
This function is used to accept a new connection from a peer into the given socket. The function call will block until a new connection has been accepted successfully or an error occurs.
peer | The socket into which the new connection will be accepted. |
asio::system_error | Thrown on failure. |
Definition at line 925 of file basic_socket_acceptor.hpp.
|
inline |
Accept a new connection.
This function is used to accept a new connection from a peer into the given socket. The function call will block until a new connection has been accepted successfully or an error occurs.
peer | The socket into which the new connection will be accepted. |
ec | Set to indicate what error occurred, if any. |
Definition at line 958 of file basic_socket_acceptor.hpp.
asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::ASIO_INITFN_RESULT_TYPE | ( | AcceptHandler | , |
void(asio::error_code) | |||
) |
Start an asynchronous accept.
This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
peer | The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called. |
handler | The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be: Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post(). |
SocketService enable_if<is_convertible<Protocol, Protocol1>::value>::type AcceptHandler asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::ASIO_INITFN_RESULT_TYPE | ( | AcceptHandler | , |
void(asio::error_code) | |||
) |
SocketService asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::ASIO_MOVE_ARG | ( | AcceptHandler | ) |
|
inline |
Definition at line 1121 of file basic_socket_acceptor.hpp.
|
inline |
Assigns an existing native acceptor to the acceptor.
Definition at line 322 of file basic_socket_acceptor.hpp.
|
inline |
Assigns an existing native acceptor to the acceptor.
Definition at line 341 of file basic_socket_acceptor.hpp.
|
inline |
Bind the acceptor to the given local endpoint.
This function binds the socket acceptor to the specified endpoint on the local machine.
endpoint | An endpoint on the local machine to which the socket acceptor will be bound. |
asio::system_error | Thrown on failure. |
Definition at line 372 of file basic_socket_acceptor.hpp.
|
inline |
Bind the acceptor to the given local endpoint.
This function binds the socket acceptor to the specified endpoint on the local machine.
endpoint | An endpoint on the local machine to which the socket acceptor will be bound. |
ec | Set to indicate what error occurred, if any. |
Definition at line 402 of file basic_socket_acceptor.hpp.
|
inline |
Cancel all asynchronous operations associated with the acceptor.
This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the asio::error::operation_aborted error.
asio::system_error | Thrown on failure. |
Definition at line 526 of file basic_socket_acceptor.hpp.
|
inline |
Cancel all asynchronous operations associated with the acceptor.
This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the asio::error::operation_aborted error.
ec | Set to indicate what error occurred, if any. |
Definition at line 541 of file basic_socket_acceptor.hpp.
|
inline |
Close the acceptor.
This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
A subsequent call to open() is required before the acceptor can again be used to again perform socket accept operations.
asio::system_error | Thrown on failure. |
Definition at line 462 of file basic_socket_acceptor.hpp.
|
inline |
Close the acceptor.
This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
A subsequent call to open() is required before the acceptor can again be used to again perform socket accept operations.
ec | Set to indicate what error occurred, if any. |
Definition at line 491 of file basic_socket_acceptor.hpp.
|
inline |
Get an option from the acceptor.
This function is used to get the current value of an option on the acceptor.
option | The option value to be obtained from the acceptor. |
asio::system_error | Thrown on failure. |
Definition at line 632 of file basic_socket_acceptor.hpp.
|
inline |
Get an option from the acceptor.
This function is used to get the current value of an option on the acceptor.
option | The option value to be obtained from the acceptor. |
ec | Set to indicate what error occurred, if any. |
Definition at line 667 of file basic_socket_acceptor.hpp.
|
inline |
Perform an IO control command on the acceptor.
This function is used to execute an IO control command on the acceptor.
command | The IO control command to be performed on the acceptor. |
asio::system_error | Thrown on failure. |
Definition at line 695 of file basic_socket_acceptor.hpp.
|
inline |
Perform an IO control command on the acceptor.
This function is used to execute an IO control command on the acceptor.
command | The IO control command to be performed on the acceptor. |
ec | Set to indicate what error occurred, if any. |
Definition at line 728 of file basic_socket_acceptor.hpp.
|
inline |
Determine whether the acceptor is open.
Definition at line 349 of file basic_socket_acceptor.hpp.
|
inline |
Place the acceptor into the state where it will listen for new connections. This function puts the socket acceptor into the state where it may accept new connections.
backlog | The maximum length of the queue of pending connections. |
asio::system_error | Thrown on failure. |
Definition at line 418 of file basic_socket_acceptor.hpp.
|
inline |
Place the acceptor into the state where it will listen for new connections. This function puts the socket acceptor into the state where it may accept new connections.
backlog | The maximum length of the queue of pending connections. |
ec | Set to indicate what error occurred, if any. |
Definition at line 447 of file basic_socket_acceptor.hpp.
|
inline |
Get the local endpoint of the acceptor.
This function is used to obtain the locally bound endpoint of the acceptor.
asio::system_error | Thrown on failure. |
Definition at line 870 of file basic_socket_acceptor.hpp.
|
inline |
Get the local endpoint of the acceptor.
This function is used to obtain the locally bound endpoint of the acceptor.
ec | Set to indicate what error occurred, if any. |
Definition at line 901 of file basic_socket_acceptor.hpp.
|
inline |
(Deprecated: Use native_handle().) Get the native acceptor representation.
This function may be used to obtain the underlying representation of the acceptor. This is intended to allow access to native acceptor functionality that is not otherwise provided.
Definition at line 502 of file basic_socket_acceptor.hpp.
|
inline |
Get the native acceptor representation.
This function may be used to obtain the underlying representation of the acceptor. This is intended to allow access to native acceptor functionality that is not otherwise provided.
Definition at line 513 of file basic_socket_acceptor.hpp.
|
inline |
Gets the non-blocking mode of the native acceptor implementation.
This function is used to retrieve the non-blocking mode of the underlying native acceptor. This mode has no effect on the behaviour of the acceptor object's synchronous operations.
true
if the underlying acceptor is in non-blocking mode and direct system calls may fail with asio::error::would_block (or the equivalent system error).Definition at line 805 of file basic_socket_acceptor.hpp.
|
inline |
Sets the non-blocking mode of the native acceptor implementation.
This function is used to modify the non-blocking mode of the underlying native acceptor. It has no effect on the behaviour of the acceptor object's synchronous operations.
mode | If true , the underlying acceptor is put into non-blocking mode and direct system calls may fail with asio::error::would_block (or the equivalent system error). |
asio::system_error | Thrown on failure. If the mode is false , but the current value of non_blocking() is true , this function fails with asio::error::invalid_argument, as the combination does not make sense. |
Definition at line 825 of file basic_socket_acceptor.hpp.
|
inline |
Sets the non-blocking mode of the native acceptor implementation.
This function is used to modify the non-blocking mode of the underlying native acceptor. It has no effect on the behaviour of the acceptor object's synchronous operations.
mode | If true , the underlying acceptor is put into non-blocking mode and direct system calls may fail with asio::error::would_block (or the equivalent system error). |
ec | Set to indicate what error occurred, if any. If the mode is false , but the current value of non_blocking() is true , this function fails with asio::error::invalid_argument, as the combination does not make sense. |
Definition at line 848 of file basic_socket_acceptor.hpp.
|
inline |
Gets the non-blocking mode of the acceptor.
true
if the acceptor's synchronous operations will fail with asio::error::would_block if they are unable to perform the requested operation immediately. If false
, synchronous operations will block until complete.Definition at line 746 of file basic_socket_acceptor.hpp.
|
inline |
Sets the non-blocking mode of the acceptor.
mode | If true , the acceptor's synchronous operations will fail with asio::error::would_block if they are unable to perform the requested operation immediately. If false , synchronous operations will block until complete. |
asio::system_error | Thrown on failure. |
Definition at line 764 of file basic_socket_acceptor.hpp.
|
inline |
Sets the non-blocking mode of the acceptor.
mode | If true , the acceptor's synchronous operations will fail with asio::error::would_block if they are unable to perform the requested operation immediately. If false , synchronous operations will block until complete. |
ec | Set to indicate what error occurred, if any. |
Definition at line 784 of file basic_socket_acceptor.hpp.
|
inline |
Open the acceptor using the specified protocol.
This function opens the socket acceptor so that it will use the specified protocol.
protocol | An object specifying which protocol is to be used. |
asio::system_error | Thrown on failure. |
Definition at line 279 of file basic_socket_acceptor.hpp.
|
inline |
Open the acceptor using the specified protocol.
This function opens the socket acceptor so that it will use the specified protocol.
protocol | An object specifying which protocol is to be used. |
ec | Set to indicate what error occurred, if any. |
Definition at line 306 of file basic_socket_acceptor.hpp.
|
inline |
Set an option on the acceptor.
This function is used to set an option on the acceptor.
option | The new option value to be set on the acceptor. |
asio::system_error | Thrown on failure. |
Definition at line 568 of file basic_socket_acceptor.hpp.
|
inline |
Set an option on the acceptor.
This function is used to set an option on the acceptor.
option | The new option value to be set on the acceptor. |
ec | Set to indicate what error occurred, if any. |
Definition at line 602 of file basic_socket_acceptor.hpp.
SocketService& asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::peer |
Definition at line 1008 of file basic_socket_acceptor.hpp.
SocketService enable_if<is_convertible<Protocol, Protocol1>::value>::type AcceptHandler SocketService& asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::peer |
Definition at line 1120 of file basic_socket_acceptor.hpp.
SocketService enable_if<is_convertible<Protocol, Protocol1>::value>::type AcceptHandler SocketService endpoint_type& asio::basic_socket_acceptor< Protocol, SocketAcceptorService >::peer_endpoint |
Definition at line 1120 of file basic_socket_acceptor.hpp.