Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / ACE / ace / UPIPE_Acceptor.h
blob14f824ab9240c1b2761e734caf07c60f590d75d5
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file UPIPE_Acceptor.h
7 * @author Gerhard Lenzer
8 * @author Douglas C. Schmidt
9 */
10 //=============================================================================
13 #ifndef ACE_UPIPE_ACCEPTOR_H
14 #define ACE_UPIPE_ACCEPTOR_H
15 #include /**/ "ace/pre.h"
17 #include "ace/UPIPE_Stream.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if defined (ACE_HAS_THREADS)
25 #include "ace/SPIPE_Acceptor.h"
26 #include "ace/Thread_Manager.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 /**
31 * @class ACE_UPIPE_Acceptor
33 * @brief Defines the format and interface for the listener side of the
34 * ACE_UPIPE_Stream.
36 class ACE_Export ACE_UPIPE_Acceptor : public ACE_SPIPE_Acceptor
38 public:
39 /// Default constructor.
40 ACE_UPIPE_Acceptor ();
42 /// Initialize passive endpoint.
43 ACE_UPIPE_Acceptor (const ACE_UPIPE_Addr &local_sap,
44 int reuse_addr = 0);
46 /// Initialize passive endpoint.
47 int open (const ACE_UPIPE_Addr &local_sap,
48 int reuse_addr = 0);
50 /// Close down and release resources.
51 ~ACE_UPIPE_Acceptor ();
53 /// Close down and release resources.
54 int close ();
56 /// Close down and release resources and remove the underlying SPIPE
57 /// rendezvous point.
58 int remove ();
60 // = Passive connection acceptance method.
61 /**
62 * Accept a new data transfer connection. A @a timeout of 0 means
63 * block forever, a @a timeout of {0, 0} means poll. @a restart == 1
64 * means "restart if interrupted."
66 int accept (ACE_UPIPE_Stream &server_stream,
67 ACE_UPIPE_Addr *remote_addr = 0,
68 ACE_Time_Value *timeout = 0,
69 bool restart = true,
70 bool reset_new_handle = false);
72 /// Dump the state of an object.
73 void dump () const;
75 /// Declare the dynamic allocation hooks.
76 ACE_ALLOC_HOOK_DECLARE;
78 private:
79 /// Manage threads.
80 ACE_Thread_Manager tm;
82 /// To confirm connection establishment.
83 ACE_Message_Block mb_;
86 ACE_END_VERSIONED_NAMESPACE_DECL
88 #if defined (__ACE_INLINE__)
89 #include "ace/UPIPE_Acceptor.inl"
90 #endif /* __ACE_INLINE__ */
92 #endif /* ACE_HAS_THREADS */
94 #include /**/ "ace/post.h"
96 #endif /* ACE_UPIPE_ACCEPTOR_H */