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