Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_LOCK_SOCK_Acceptor Class Template Reference

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

#include <LOCK_SOCK_Acceptor.h>

Inheritance diagram for ACE_LOCK_SOCK_Acceptor:

Inheritance graph
Collaboration diagram for ACE_LOCK_SOCK_Acceptor:

Collaboration graph
List of all members.

Public Methods

int accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr=0, ACE_Time_Value *timeout=0, int restart=1, int reset_new_handle=0) const
 Accept the connection under the control of the <ACE_LOCK>. More...

ACE_LOCK & lock (void)
 Return a reference to the lock. More...

Protected Attributes

ACE_LOCK lock_
 Type of locking mechanism. 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.

Definition at line 35 of file LOCK_SOCK_Acceptor.h.

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,
int    restart = 1,
int    reset_new_handle = 0

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

Reimplemented from ACE_SOCK_Acceptor.

Definition at line 12 of file LOCK_SOCK_Acceptor.cpp.

References ACE_SOCK_Acceptor::accept, and ACE_GUARD_RETURN.

00017 {
00018   ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, -1);
00020   return ACE_SOCK_Acceptor::accept (stream,
00021                                     remote_address,
00022                                     timeout,
00023                                     restart,
00024                                     reset_new_handle);
00025 }

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

Return a reference to the lock.

Definition at line 28 of file LOCK_SOCK_Acceptor.cpp.

References lock_.

00029 {
00030   return this->lock_;
00031 }

Member Data Documentation

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

Type of locking mechanism.

Definition at line 50 of file LOCK_SOCK_Acceptor.h.

Referenced by lock.

The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:49:25 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002