00001 /* -*- C++ -*- */ 00002 00003 //============================================================================= 00004 /** 00005 * @file UPIPE_Acceptor.h 00006 * 00007 * $Id: UPIPE_Acceptor.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $ 00008 * 00009 * @author Gerhard Lenzer 00010 * @author Douglas C. Schmidt 00011 */ 00012 //============================================================================= 00013 00014 00015 #ifndef ACE_UPIPE_ACCEPTOR_H 00016 #define ACE_UPIPE_ACCEPTOR_H 00017 #include "ace/pre.h" 00018 00019 #include "ace/UPIPE_Stream.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "ace/Synch.h" 00026 #include "ace/SPIPE_Acceptor.h" 00027 #include "ace/Thread_Manager.h" 00028 00029 #if defined (ACE_HAS_THREADS) 00030 00031 /** 00032 * @class ACE_UPIPE_Acceptor 00033 * 00034 * @brief Defines the format and interface for the listener side of the 00035 * ACE_UPIPE_Stream. 00036 */ 00037 class ACE_Export ACE_UPIPE_Acceptor : public ACE_SPIPE_Acceptor 00038 { 00039 public: 00040 // = Initialization and termination. 00041 /// Default constructor. 00042 ACE_UPIPE_Acceptor (void); 00043 00044 /// Initialize passive endpoint. 00045 ACE_UPIPE_Acceptor (const ACE_UPIPE_Addr &local_sap, 00046 int reuse_addr = 0); 00047 00048 /// Initialize passive endpoint. 00049 int open (const ACE_UPIPE_Addr &local_sap, 00050 int reuse_addr = 0); 00051 00052 /// Close down and release resources. 00053 ~ACE_UPIPE_Acceptor (void); 00054 00055 /// Close down and release resources. 00056 int close (void); 00057 00058 /// Close down and release resources and remove the underlying SPIPE 00059 /// rendezvous point. 00060 int remove (void); 00061 00062 // = Passive connection acceptance method. 00063 /** 00064 * Accept a new data transfer connection. A @a timeout of 0 means 00065 * block forever, a @a timeout of {0, 0} means poll. @a restart == 1 00066 * means "restart if interrupted." 00067 */ 00068 int accept (ACE_UPIPE_Stream &server_stream, 00069 ACE_UPIPE_Addr *remote_addr = 0, 00070 ACE_Time_Value *timeout = 0, 00071 int restart = 1, 00072 int reset_new_handle = 0); 00073 00074 /// Dump the state of an object. 00075 void dump (void) const; 00076 00077 /// Declare the dynamic allocation hooks. 00078 ACE_ALLOC_HOOK_DECLARE; 00079 00080 private: 00081 /// Manage threads. 00082 ACE_Thread_Manager tm; 00083 00084 /// To confirm connection establishment. 00085 ACE_Message_Block mb_; 00086 }; 00087 00088 #if !defined (ACE_LACKS_INLINE_FUNCTIONS) 00089 #include "ace/UPIPE_Acceptor.i" 00090 #endif 00091 00092 #endif /* ACE_HAS_THREADS */ 00093 #include "ace/post.h" 00094 #endif /* ACE_UPIPE_ACCEPTOR_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002