diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-01 21:22:41 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-01 21:22:41 +0000 |
commit | 85fbf984ecc7c7ea2f7c02cff5807e1a8bf6af64 (patch) | |
tree | 3c348090e4f36f4a2b480509917214859aa783c5 /examples | |
parent | 61e0c4b1741dc427bc41979516825d2f29e26541 (diff) | |
download | ATCD-85fbf984ecc7c7ea2f7c02cff5807e1a8bf6af64.tar.gz |
*** empty log message ***
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Reactor/Dgram/Dgram.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/Reactor/Dgram/Dgram.cpp b/examples/Reactor/Dgram/Dgram.cpp index ca62c64bfbd..3c6e18dd3a5 100644 --- a/examples/Reactor/Dgram/Dgram.cpp +++ b/examples/Reactor/Dgram/Dgram.cpp @@ -57,6 +57,9 @@ Dgram_Endpoint::handle_close (ACE_HANDLE handle, ACE_UNUSED_ARG (handle); this->endpoint_.close (); + + delete this; + return 0; } @@ -96,11 +99,11 @@ run_test (u_short localport, remotehost); ACE_INET_Addr local_addr (localport); - Dgram_Endpoint endpoint (local_addr); + Dgram_Endpoint *endpoint = new Dgram_Endpoint (local_addr); // Read data from other side. if (ACE_Reactor::instance ()->register_handler - (&endpoint, ACE_Event_Handler::READ_MASK) == -1) + (endpoint, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "ACE_Reactor::register_handler"), -1); @@ -115,7 +118,7 @@ run_test (u_short localport, for (size_t i = 0; i < 20; i++) { - endpoint.send (buf, len, remote_addr); + endpoint->send (buf, len, remote_addr); ACE_DEBUG ((LM_DEBUG, "(%P|%t) .\n")); ACE_OS::sleep (1); } @@ -135,14 +138,14 @@ run_test (u_short localport, ACE_DEBUG ((LM_DEBUG, "(%P|%t) return from handle events\n")); - endpoint.send (buf, len, remote_addr); + endpoint->send (buf, len, remote_addr); ACE_DEBUG ((LM_DEBUG, "(%P|%t) .\n")); } if (ACE_Reactor::instance ()->remove_handler - (&endpoint, ACE_Event_Handler::READ_MASK) == -1) + (endpoint, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "ACE_Reactor::remove_handler"), -1); |