|
Public Member Functions |
| ACE_Asynch_Acceptor (void) |
| A do nothing constructor.
|
virtual | ~ACE_Asynch_Acceptor (void) |
| Virtual destruction.
|
virtual int | open (const ACE_INET_Addr &address, size_t bytes_to_read=0, int pass_addresses=0, int backlog=ACE_DEFAULT_BACKLOG, int reuse_addr=1, ACE_Proactor *proactor=0, int validate_new_connection=0, int reissue_accept=1, int number_of_initial_accepts=-1) |
virtual ACE_HANDLE | get_handle (void) const |
| Get the underlying handle.
|
virtual void | set_handle (ACE_HANDLE handle) |
virtual int | accept (size_t bytes_to_read=0, const void *act=0) |
| This initiates a new asynchronous accept operation.
|
virtual int | cancel (void) |
virtual int | validate_connection (const ACE_Asynch_Accept::Result &result, const ACE_INET_Addr &remote, const ACE_INET_Addr &local) |
virtual int | validate_new_connection (const ACE_INET_Addr &remote_address) |
virtual int | should_reissue_accept (void) |
virtual int | pass_addresses (void) const |
virtual void | pass_addresses (int new_value) |
virtual int | validate_new_connection (void) const |
| Get flag that indicates if address validation is required.
|
virtual void | validate_new_connection (int new_value) |
| Set flag that indicates if address validation is required.
|
virtual int | reissue_accept (void) const |
virtual void | reissue_accept (int new_value) |
virtual size_t | bytes_to_read (void) const |
| Get bytes to be read with the <accept> call.
|
virtual void | bytes_to_read (size_t new_value) |
| Set bytes to be read with the <accept> call.
|
Static Public Member Functions |
size_t | address_size (void) |
Protected Member Functions |
virtual void | handle_accept (const ACE_Asynch_Accept::Result &result) |
| This is called when an outstanding accept completes.
|
ACE_HANDLE | handle (void) const |
| Return the listen handle.
|
void | handle (ACE_HANDLE h) |
| Set the listen handle.
|
void | parse_address (const ACE_Asynch_Accept::Result &result, ACE_INET_Addr &remote_address, ACE_INET_Addr &local_address) |
| This parses the address from read buffer.
|
ACE_Asynch_Accept & | asynch_accept (void) |
| Return the asynch accept object.
|
virtual HANDLER * | make_handler (void) |
Private Attributes |
ACE_HANDLE | listen_handle_ |
| Handle used to listen for new connections.
|
ACE_Asynch_Accept | asynch_accept_ |
| Asynch_Accept used to make life easier :-).
|
int | pass_addresses_ |
| Flag that indicates if parsing of addresses is necessary.
|
int | validate_new_connection_ |
| Flag that indicates if address validation is required.
|
int | reissue_accept_ |
size_t | bytes_to_read_ |
| Bytes to be read with the <accept> call.
|
int | addr_family_ |
|
open starts one or more asynchronous accept requests on a address. Each accept operation may optionally read an initial buffer from the new connection when accepted.
- Parameters:
-
| address | The address to listen/accept connections on. If the address does not specify a port, a random port is selected and bound. |
| bytes_to_read | Optional, specifies the maximum number of bytes to read with the accept. The buffer for the initial data is allocated internally and passed to the ACE_Service_Handler::open() hook method. It is legitimate only during the open() method and must be copied if required after open() returns. This pre-read function works only on Windows. |
| pass_addresses | Optional, a non-zero value indicates that the local and peer addresses should be passed to the associated ACE_Service_Handler::addresses() method after any call to validate_new_connection() and prior to the open() hook method call. |
| backlog | Optional, defaulting to ACE_DEFAULT_BACKLOG (which can be adjusted in your platform's config.h file). Specifies the listening backlog for the listening socket. |
| reuse_addr | Optional, indicates whether the SO_REUSEADDR option is set on the listening socket or not. |
| proactor | Optional, pointer to the ACE_Proactor to use for demultiplexing asynchronous accepts. If 0, the process's singleton ACE_Proactor is used. |
| validate_new_connection | Optional, if non-zero, this object's validate_connection() method is called after the accept completes, but before the service handler's open() hook method is called. If validate_connection() returns -1, the newly-accepted socket is immediately closed, and the addresses() method is not called. |
| reissue_accept | Optional, if non-zero (the default), a new asynchronous accept operation is started after each completion, whether the completion is for success or failure, and whether or not a successfully-accepted connection is subsequently refused. |
| number_of_initial_accepts | Optional, the number of asynchronous accepts that are started immediately. If -1 (the default), the value of backlog is used. |
- Note:
- On Windows, the peer address is only available at the time the connection is accepted. Therefore, if you require the peer address on Windows, do not rely on the
ACE_SOCK::get_remote_addr() method - it won't work. You must supply a non-zero value for pass_addresses and obtain the peer address in the ACE_Service_Handler::addresses() method.
- See also:
- ACE_INET_Addr
ACE_Service_Handler
|