summaryrefslogtreecommitdiff
path: root/examples/Reactor
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-09-29 16:26:53 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-09-29 16:26:53 +0000
commitfe9d3c146bf4cffc29607cf56d78cd917331e655 (patch)
treef9e9684abcda93d4263775c8bc141ceec6f094d2 /examples/Reactor
parentdc2da40a95be71622c1b01fbb89c6ac28ab7446a (diff)
downloadATCD-fe9d3c146bf4cffc29607cf56d78cd917331e655.tar.gz
*** empty log message ***
Diffstat (limited to 'examples/Reactor')
-rw-r--r--examples/Reactor/ReactorEx/test_network_events.cpp21
-rw-r--r--examples/Reactor/WFMO_Reactor/test_network_events.cpp21
2 files changed, 38 insertions, 4 deletions
diff --git a/examples/Reactor/ReactorEx/test_network_events.cpp b/examples/Reactor/ReactorEx/test_network_events.cpp
index a954f626e5e..3dfce3d2102 100644
--- a/examples/Reactor/ReactorEx/test_network_events.cpp
+++ b/examples/Reactor/ReactorEx/test_network_events.cpp
@@ -32,6 +32,7 @@
// ============================================================================
#include "ace/Reactor.h"
+#include "ace/WFMO_Reactor.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Acceptor.h"
@@ -149,8 +150,24 @@ Network_Listener::handle_input (ACE_HANDLE handle)
ACE_INET_Addr remote_address;
ACE_SOCK_Stream stream;
- ACE_ASSERT (this->acceptor_.accept (stream, &remote_address) == 0);
-
+ int reset_new_handle = 0;
+#if defined (ACE_WIN32)
+ // Try to find out if the implementation of the reactor that we are
+ // using is the WFMO_Reactor. If so we need to reset the event
+ // association for the newly created handle. This is because the
+ // newly created handle will inherit the properties of the listen
+ // handle, including its event associations.
+ if (dynamic_cast <ACE_WFMO_Reactor *> (this->reactor ()->implementation ()))
+ reset_new_handle = 1;
+#endif /* ACE_WIN32 */
+
+ ACE_ASSERT (this->acceptor_.accept (stream, // stream
+ &remote_address, // remote address
+ 0, // timeout
+ 1, // restart
+ reset_new_handle // reset new handler
+ ) == 0);
+
ACE_DEBUG ((LM_DEBUG, "Remote connection from: "));
remote_address.dump ();
diff --git a/examples/Reactor/WFMO_Reactor/test_network_events.cpp b/examples/Reactor/WFMO_Reactor/test_network_events.cpp
index a954f626e5e..3dfce3d2102 100644
--- a/examples/Reactor/WFMO_Reactor/test_network_events.cpp
+++ b/examples/Reactor/WFMO_Reactor/test_network_events.cpp
@@ -32,6 +32,7 @@
// ============================================================================
#include "ace/Reactor.h"
+#include "ace/WFMO_Reactor.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Acceptor.h"
@@ -149,8 +150,24 @@ Network_Listener::handle_input (ACE_HANDLE handle)
ACE_INET_Addr remote_address;
ACE_SOCK_Stream stream;
- ACE_ASSERT (this->acceptor_.accept (stream, &remote_address) == 0);
-
+ int reset_new_handle = 0;
+#if defined (ACE_WIN32)
+ // Try to find out if the implementation of the reactor that we are
+ // using is the WFMO_Reactor. If so we need to reset the event
+ // association for the newly created handle. This is because the
+ // newly created handle will inherit the properties of the listen
+ // handle, including its event associations.
+ if (dynamic_cast <ACE_WFMO_Reactor *> (this->reactor ()->implementation ()))
+ reset_new_handle = 1;
+#endif /* ACE_WIN32 */
+
+ ACE_ASSERT (this->acceptor_.accept (stream, // stream
+ &remote_address, // remote address
+ 0, // timeout
+ 1, // restart
+ reset_new_handle // reset new handler
+ ) == 0);
+
ACE_DEBUG ((LM_DEBUG, "Remote connection from: "));
remote_address.dump ();