00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 #ifndef ACE_MEM_ACCEPTOR_H
00014 #define ACE_MEM_ACCEPTOR_H
00015 #include  "ace/pre.h"
00016 
00017 #include  "ace/ACE_export.h"
00018 
00019 #include "ace/SOCK_Acceptor.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif 
00024 
00025 #if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
00026 
00027 #include "ace/MEM_Stream.h"
00028 #include "ace/MEM_Addr.h"
00029 
00030 #if !defined (ACE_HAS_WINCE)
00031 #include "ace/OS_QoS.h"
00032 #endif  // ACE_HAS_WINCE
00033 
00034 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 
00037 class ACE_Reactor;
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 class ACE_Export ACE_MEM_Acceptor : public ACE_SOCK_Acceptor
00055 {
00056 public:
00057   
00058 
00059   ACE_MEM_Acceptor (void);
00060 
00061 
00062   ~ACE_MEM_Acceptor (void);
00063 
00064 
00065   ACE_MEM_Acceptor (const ACE_MEM_Addr &remote_sap,
00066                     int reuse_addr = 0,
00067                     int backlog = ACE_DEFAULT_BACKLOG,
00068                     int protocol = 0);
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077   int open (const ACE_MEM_Addr &local_sap,
00078             int reuse_addr = 0,
00079             int backlog = ACE_DEFAULT_BACKLOG,
00080             int protocol = 0);
00081 
00082 
00083   int accept (ACE_MEM_Stream &new_ipc_sap,
00084               ACE_MEM_Addr *remote_addr = 0,
00085               ACE_Time_Value *timeout = 0,
00086               int restart = 1,
00087               int reset_new_handle = 0);
00088 
00089 
00090 
00091   int shared_accept_finish (ACE_MEM_Stream new_stream,
00092                             int in_blocking_mode,
00093                             int reset_new_handle) const;
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104   const ACE_TCHAR *mmap_prefix (void) const;
00105   void mmap_prefix (const ACE_TCHAR *prefix);
00106 
00107 
00108 
00109 
00110 
00111   void init_buffer_size (ACE_OFF_T bytes);
00112 
00113 
00114   ACE_MEM_IO::Signal_Strategy preferred_strategy (void) const;
00115 
00116 
00117   void preferred_strategy (ACE_MEM_IO::Signal_Strategy strategy);
00118 
00119 
00120 
00121   int get_local_addr (ACE_MEM_Addr &) const;
00122 
00123 
00124 
00125   ACE_MEM_SAP::MALLOC_OPTIONS& malloc_options (void);
00126 
00127   
00128   typedef ACE_MEM_Addr PEER_ADDR;
00129   typedef ACE_MEM_Stream PEER_STREAM;
00130 
00131 
00132   void dump (void) const;
00133 
00134 
00135   ACE_ALLOC_HOOK_DECLARE;
00136 
00137 protected:
00138   
00139   
00140   int open (const ACE_Addr &local_sap,
00141             int reuse_addr = 0,
00142             int protocol_family = PF_INET,
00143             int backlog = ACE_DEFAULT_BACKLOG,
00144             int protocol = 0);
00145 
00146   int open (const ACE_Addr &local_sap,
00147             ACE_Protocol_Info *protocolinfo,
00148             ACE_SOCK_GROUP g,
00149             u_long flags,
00150             int reuse_addr,
00151             int protocol_family,
00152             int backlog = ACE_DEFAULT_BACKLOG,
00153             int protocol = 0);
00154 
00155   int accept (ACE_SOCK_Stream &new_stream,
00156               ACE_Addr *remote_addr = 0,
00157               ACE_Time_Value *timeout = 0,
00158               int restart = 1,
00159               int reset_new_handle = 0) const;
00160 
00161 #if !defined (ACE_HAS_WINCE)
00162   int accept (ACE_SOCK_Stream &new_stream,
00163               ACE_Accept_QoS_Params qos_params,
00164               ACE_Addr *remote_addr = 0,
00165               ACE_Time_Value *timeout = 0,
00166               int restart = 1,
00167               int reset_new_handle = 0) const;
00168 #endif  // ACE_HAS_WINCE
00169 
00170 private:
00171 
00172 
00173   ACE_TCHAR *mmap_prefix_;
00174 
00175 
00176 
00177   ACE_MEM_SAP::MALLOC_OPTIONS malloc_options_;
00178 
00179 
00180   ACE_MEM_IO::Signal_Strategy preferred_strategy_;
00181 };
00182 
00183 ACE_END_VERSIONED_NAMESPACE_DECL
00184 
00185 #if defined (__ACE_INLINE__)
00186 #include "ace/MEM_Acceptor.inl"
00187 #endif 
00188 
00189 #endif 
00190 
00191 #include  "ace/post.h"
00192 #endif