ATM_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    ATM_Acceptor.h
00006  *
00007  *  ATM_Acceptor.h,v 4.18 2006/03/04 14:19:44 zhangw Exp
00008  *
00009  *  @author Joe Hoffert
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_ATM_ACCEPTOR_H
00015 #define ACE_ATM_ACCEPTOR_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #if defined (ACE_HAS_ATM)
00025 
00026 #include "ace/ATM_Stream.h"
00027 #include "ace/ATM_Params.h"
00028 #include "ace/ATM_QoS.h"
00029 
00030 #if defined (ACE_HAS_LINUX_ATM)
00031 #include /**/ "atm.h"
00032 #endif /* ACE_HAS_LINUX_ATM */
00033 
00034 #if defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM)
00035 #include "ace/SOCK_Acceptor.h"
00036 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00037 typedef ACE_SOCK_Acceptor ATM_Acceptor;
00038 ACE_END_VERSIONED_NAMESPACE_DECL
00039 #elif defined (ACE_HAS_FORE_ATM_XTI)
00040 #include "ace/TLI_Acceptor.h"
00041 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00042 typedef ACE_TLI_Acceptor ATM_Acceptor;
00043 ACE_END_VERSIONED_NAMESPACE_DECL
00044 #endif // ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM
00045 
00046 // Open versioned namespace, if enabled by the user.
00047 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00048 
00049 // Forward declarations.
00050 class ACE_Time_Value;
00051 
00052 /**
00053  * @class ACE_ATM_Acceptor
00054  *
00055  * @brief Defines the member functions for ACE_ATM_Acceptor abstraction.
00056  *
00057  * This class wraps up the ACE_SOCK_Acceptor and ACE_TLI_Acceptor
00058  * to make the mechanism for the ATM protocol transparent.
00059  */
00060 class ACE_Export ACE_ATM_Acceptor
00061 {
00062 
00063 public:
00064   // = Initialization and termination methods.
00065   /// Default constructor.
00066   ACE_ATM_Acceptor (void);
00067 
00068   ~ACE_ATM_Acceptor ();
00069 
00070   /// Initiate a passive mode connection.
00071   ACE_ATM_Acceptor (const ACE_Addr &remote_sap,
00072                     int backlog = ACE_DEFAULT_BACKLOG,
00073                     ACE_ATM_Params params = ACE_ATM_Params());
00074 
00075   /// Initiate a passive mode socket.
00076   ACE_HANDLE open (const ACE_Addr &remote_sap,
00077                    int backlog = ACE_DEFAULT_BACKLOG,
00078                    ACE_ATM_Params params = ACE_ATM_Params());
00079 
00080   /// Close down the acceptor and release resources.
00081   int close (void);
00082 
00083   // = Passive connection acceptance method.
00084 
00085   /// Accept a new data transfer connection.  A @a timeout of 0 means
00086   /// block forever, a @a timeout of {0, 0} means poll. @a restart == 1
00087   /// means "restart if interrupted."
00088   int accept (ACE_ATM_Stream &new_sap,
00089               ACE_Addr *remote_addr = 0,
00090               ACE_Time_Value *timeout = 0,
00091               int restart = 1,
00092               int reset_new_handle = 0,
00093               ACE_ATM_Params params = ACE_ATM_Params(),
00094               ACE_ATM_QoS qos = ACE_ATM_QoS());
00095 
00096   /// Get the local address currently listening on
00097   int get_local_addr( ACE_ATM_Addr &local_addr );
00098 
00099   // = Meta-type info
00100   typedef ACE_ATM_Addr PEER_ADDR;
00101   typedef ACE_ATM_Stream PEER_STREAM;
00102 
00103   /// Dump the state of an object.
00104   void dump (void) const;
00105 
00106   /// Declare the dynamic allocation hooks.
00107   ACE_ALLOC_HOOK_DECLARE;
00108 
00109 private:
00110   ATM_Acceptor acceptor_;
00111 };
00112 
00113 // Close versioned namespace, if enabled by the user.
00114 ACE_END_VERSIONED_NAMESPACE_DECL
00115 
00116 
00117 #if defined (__ACE_INLINE__)
00118 #include "ace/ATM_Acceptor.inl"
00119 #endif /* __ACE_INLINE__ */
00120 
00121 #endif /* ACE_HAS_ATM */
00122 #include /**/ "ace/post.h"
00123 #endif /* ACE_ATM_ACCEPTOR_H */

Generated on Thu Nov 9 09:41:46 2006 for ACE by doxygen 1.3.6