00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef ACE_TLI_ACCEPTOR_H
00015 #define ACE_TLI_ACCEPTOR_H
00016 #include  "ace/pre.h"
00017 
00018 #include "ace/TLI.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif 
00023 
00024 #include "ace/TLI_Stream.h"
00025 #include "ace/Default_Constants.h"
00026 
00027 #if defined (ACE_HAS_TLI)
00028 
00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 
00032 class ACE_TLI_Request_Queue;
00033 class ACE_Time_Value;
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 class ACE_Export ACE_TLI_Acceptor : public ACE_TLI
00046 {
00047 public:
00048   friend class ACE_Request_Queue;
00049 
00050   
00051 
00052   ACE_TLI_Acceptor (void);
00053 
00054 
00055   ACE_TLI_Acceptor (const ACE_Addr &remote_sap,
00056                     int reuse_addr = 0,
00057                     int oflag = O_RDWR,
00058                     struct t_info *info = 0,
00059                     int backlog = ACE_DEFAULT_BACKLOG,
00060                     const char device[] = ACE_TLI_TCP_DEVICE);
00061 
00062 
00063   ACE_HANDLE open (const ACE_Addr &remote_sap,
00064                    int reuse_addr = 0,
00065                    int oflag = O_RDWR,
00066                    struct t_info *info = 0,
00067                    int backlog = ACE_DEFAULT_BACKLOG,
00068                    const char device[] = ACE_TLI_TCP_DEVICE);
00069 
00070 
00071   int close (void);
00072 
00073   
00074 
00075 
00076 
00077 
00078 
00079 
00080   int accept (ACE_TLI_Stream &new_tli_sap,
00081               ACE_Addr *remote_addr = 0,
00082               ACE_Time_Value *timeout = 0,
00083               int restart = 1,
00084               int reset_new_handle = 0,
00085               int rwflag = 1,
00086               netbuf *udata = 0,
00087               netbuf *opt = 0);
00088 
00089   
00090   typedef ACE_INET_Addr PEER_ADDR;
00091   typedef ACE_TLI_Stream PEER_STREAM;
00092 
00093 
00094   void dump (void) const;
00095 
00096 
00097   ACE_ALLOC_HOOK_DECLARE;
00098 
00099 private:
00100 
00101   const char *device_;
00102 
00103 
00104   int backlog_;
00105 
00106 
00107   int rwflag_;
00108 
00109 
00110   int handle_async_event (int restart, int rwflag);
00111 
00112 
00113   ACE_TLI_Request_Queue *queue_;
00114 
00115 
00116   struct t_discon *disp_;
00117 };
00118 
00119 ACE_END_VERSIONED_NAMESPACE_DECL
00120 
00121 #endif 
00122 #include  "ace/post.h"
00123 #endif