ACE_SOCK_Acceptor
to lock around accept
;
#include <ace/LOCK_SOCK_Acceptor.h>
template<class ACE_LOCK> class ACE_LOCK_SOCK_Acceptor : public ACE_SOCK_Acceptor {
public:
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;
ACE_LOCK &lock (void);
protected:
ACE_LOCK lock_;
};
accept
on the same listen-mode
port/socket. Thus, we need to protect against multiple
concurrent accesses by using the appropriate type of lock.
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;
ACE_LOCK
.
ACE_LOCK &lock (void);
ACE_LOCK lock_;