ACE  6.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
ACE_LOCK_SOCK_Acceptor< ACE_LOCK > Class Template Reference

Specialize ACE_SOCK_Acceptor to lock around <accept>;. More...

#include <LOCK_SOCK_Acceptor.h>

Inheritance diagram for ACE_LOCK_SOCK_Acceptor< ACE_LOCK >:
Inheritance graph
[legend]
Collaboration diagram for ACE_LOCK_SOCK_Acceptor< ACE_LOCK >:
Collaboration graph
[legend]

Public Member Functions

int accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr=0, ACE_Time_Value *timeout=0, bool restart=true, bool reset_new_handle=false) const
 Accept the connection under the control of the <ACE_LOCK>. More...
 
ACE_LOCK & lock (void)
 Return a reference to the lock. More...
 
- Public Member Functions inherited from ACE_SOCK_Acceptor
 ACE_SOCK_Acceptor (void)
 Default constructor. More...
 
 ACE_SOCK_Acceptor (const ACE_Addr &local_sap, int reuse_addr=0, int protocol_family=PF_UNSPEC, int backlog=ACE_DEFAULT_BACKLOG, int protocol=0)
 
 ACE_SOCK_Acceptor (const ACE_Addr &local_sap, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr, int protocol_family=PF_UNSPEC, int backlog=ACE_DEFAULT_BACKLOG, int protocol=0)
 
int open (const ACE_Addr &local_sap, int reuse_addr=0, int protocol_family=PF_UNSPEC, int backlog=ACE_DEFAULT_BACKLOG, int protocol=0)
 
int open (const ACE_Addr &local_sap, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr, int protocol_family=PF_UNSPEC, int backlog=ACE_DEFAULT_BACKLOG, int protocol=0)
 
int close (void)
 Close the socket. Returns 0 on success and -1 on failure. More...
 
 ~ACE_SOCK_Acceptor (void)
 Default dtor. More...
 
int accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr=0, ACE_Time_Value *timeout=0, bool restart=true, bool reset_new_handle=false) const
 
int accept (ACE_SOCK_Stream &new_stream, ACE_Accept_QoS_Params qos_params, ACE_Addr *remote_addr=0, ACE_Time_Value *timeout=0, bool restart=true, bool reset_new_handle=false) const
 
void dump (void) const
 Dump the state of an object. More...
 
- Public Member Functions inherited from ACE_SOCK
int set_option (int level, int option, void *optval, int optlen) const
 Wrapper around the setsockopt system call. More...
 
int get_option (int level, int option, void *optval, int *optlen) const
 Wrapper around the getsockopt system call. More...
 
int close (void)
 
int get_local_addr (ACE_Addr &) const
 
int get_remote_addr (ACE_Addr &) const
 
void dump (void) const
 Dump the state of an object. More...
 
int open (int type, int protocol_family, int protocol, int reuse_addr)
 Wrapper around the BSD-style socket system call (no QoS). More...
 
int open (int type, int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr)
 Wrapper around the QoS-enabled WSASocket function. More...
 
- Public Member Functions inherited from ACE_IPC_SAP
int control (int cmd, void *) const
 Interface for <ioctl>. More...
 
int enable (int value) const
 
int disable (int value) const
 
ACE_HANDLE get_handle (void) const
 Get the underlying handle. More...
 
void set_handle (ACE_HANDLE handle)
 Set the underlying handle. More...
 
void dump (void) const
 Dump the state of an object. More...
 

Protected Attributes

ACE_LOCK lock_
 Type of locking mechanism. More...
 

Additional Inherited Members

- Public Types inherited from ACE_SOCK_Acceptor
typedef ACE_INET_Addr PEER_ADDR
 
typedef ACE_SOCK_Stream PEER_STREAM
 
- Public Attributes inherited from ACE_SOCK_Acceptor
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_SOCK
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_IPC_SAP
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Protected Member Functions inherited from ACE_SOCK_Acceptor
int shared_accept_start (ACE_Time_Value *timeout, bool restart, int &in_blocking_mode) const
 
int shared_accept_finish (ACE_SOCK_Stream new_stream, int in_blocking_mode, bool reset_new_handle) const
 
int shared_open (const ACE_Addr &local_sap, int protocol_family, int backlog)
 
- Protected Member Functions inherited from ACE_SOCK
 ACE_SOCK (int type, int protocol_family, int protocol=0, int reuse_addr=0)
 
 ACE_SOCK (int type, int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr)
 
 ACE_SOCK (void)
 
 ~ACE_SOCK (void)
 Protected destructor. More...
 
- Protected Member Functions inherited from ACE_IPC_SAP
 ACE_IPC_SAP (void)
 Default constructor. More...
 
 ~ACE_IPC_SAP (void)
 Protected destructor. More...
 

Detailed Description

template<class ACE_LOCK>
class ACE_LOCK_SOCK_Acceptor< ACE_LOCK >

Specialize ACE_SOCK_Acceptor to lock around <accept>;.

This class is necessary since some OS platforms (e.g., Solaris 2.5) do not allow multiple threads/processes to simultaneously call <accept> on the same listen-mode port/socket. Thus, we need to protect against multiple concurrent accesses by using the appropriate type of lock.

Member Function Documentation

template<class ACE_LOCK >
int ACE_LOCK_SOCK_Acceptor< ACE_LOCK >::accept ( ACE_SOCK_Stream new_stream,
ACE_Addr remote_addr = 0,
ACE_Time_Value timeout = 0,
bool  restart = true,
bool  reset_new_handle = false 
) const

Accept the connection under the control of the <ACE_LOCK>.

template<class ACE_LOCK >
ACE_LOCK & ACE_LOCK_SOCK_Acceptor< ACE_LOCK >::lock ( void  )

Return a reference to the lock.

Member Data Documentation

template<class ACE_LOCK >
ACE_LOCK ACE_LOCK_SOCK_Acceptor< ACE_LOCK >::lock_
protected

Type of locking mechanism.


The documentation for this class was generated from the following files: