3 //=============================================================================
5 * @file LOCK_SOCK_Acceptor.h
7 * @author James Hu and Irfan Pyarali
9 //=============================================================================
12 #ifndef ACE_LOCK_SOCK_ACCEPTOR_H
13 #define ACE_LOCK_SOCK_ACCEPTOR_H
14 #include /**/ "ace/pre.h"
16 #include "ace/SOCK_Acceptor.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 * @class ACE_LOCK_SOCK_Acceptor
27 * @brief Specialize ACE_SOCK_Acceptor to lock around <accept>;
29 * This class is necessary since some OS platforms do not allow
30 * multiple threads/processes to simultaneously call @c accept
31 * on the same listen-mode port/socket. Thus, we need to
32 * protect against multiple concurrent accesses by using
33 * the appropriate type of lock.
35 template <class ACE_LOCK
>
36 class ACE_LOCK_SOCK_Acceptor
: public ACE_SOCK_Acceptor
39 /// Accept the connection under the control of the <ACE_LOCK>.
40 int accept (ACE_SOCK_Stream
&new_stream
,
41 ACE_Addr
*remote_addr
= 0,
42 ACE_Time_Value
*timeout
= 0,
44 bool reset_new_handle
= false) const;
46 /// Return a reference to the lock.
50 /// Type of locking mechanism.
54 ACE_END_VERSIONED_NAMESPACE_DECL
56 #include "ace/LOCK_SOCK_Acceptor.cpp"
58 #include /**/ "ace/post.h"
59 #endif /* ACE_LOCK_SOCK_ACCEPTOR_H */