diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-11 20:04:22 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-11 20:04:22 +0000 |
commit | 1e2358a91f064e02419bd733079e914fea2f68e2 (patch) | |
tree | b772dadf045affee6d8426e0d298d5644779d6dd /examples | |
parent | 6f389a8fa13e1565b84111da5e0cdeb8162ca306 (diff) | |
download | ATCD-1e2358a91f064e02419bd733079e914fea2f68e2.tar.gz |
(run_test): added return 0 at end so that the function always returns a value.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Reactor/Dgram/CODgram.cpp | 18 | ||||
-rw-r--r-- | examples/Reactor/Dgram/Dgram.cpp | 18 |
2 files changed, 20 insertions, 16 deletions
diff --git a/examples/Reactor/Dgram/CODgram.cpp b/examples/Reactor/Dgram/CODgram.cpp index 8f0d71afba7..f322f40d0c1 100644 --- a/examples/Reactor/Dgram/CODgram.cpp +++ b/examples/Reactor/Dgram/CODgram.cpp @@ -20,8 +20,8 @@ public: virtual int handle_input (ACE_HANDLE handle); - virtual int handle_timeout (const ACE_Time_Value & tv, - const void *arg = 0); + virtual int handle_timeout (const ACE_Time_Value & tv, + const void *arg = 0); }; AAL_CP::AAL_CP (const ACE_INET_Addr &remote_addr, @@ -42,7 +42,7 @@ AAL_CP::handle_input (ACE_HANDLE) char buf[BUFSIZ]; ACE_DEBUG ((LM_DEBUG, "(%P|%t) activity occurred on handle %d!\n", - ACE_SOCK_CODgram::get_handle ())); + ACE_SOCK_CODgram::get_handle ())); ssize_t n = ACE_SOCK_CODgram::recv (buf, sizeof buf); @@ -50,7 +50,7 @@ AAL_CP::handle_input (ACE_HANDLE) ACE_ERROR ((LM_ERROR, "%p\n", "handle_input")); else ACE_DEBUG ((LM_DEBUG, "(%P|%t) buf of size %d = %*s\n", n, n, buf)); - + return 0; } @@ -62,7 +62,7 @@ AAL_CP::handle_timeout (const ACE_Time_Value &, const void *) } static int -run_test (u_short localport, +run_test (u_short localport, const char *remotehost, u_short remoteport) { @@ -73,7 +73,7 @@ run_test (u_short localport, AAL_CP aal (remote_addr, local_addr); // Read data from other side. - if (ACE_Reactor::instance ()->register_handler + if (ACE_Reactor::instance ()->register_handler (&aal, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "ACE_Reactor::register_handler"), @@ -83,7 +83,7 @@ run_test (u_short localport, ACE_OS::strcpy (buf, "Data to transmit"); size_t len = ACE_OS::strlen (buf); - if (localport == port1) + if (localport == port1) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) sending data\n")); @@ -122,6 +122,8 @@ run_test (u_short localport, -1); ACE_DEBUG ((LM_DEBUG, "(%P|%t) exiting\n")); + + return 0; } int @@ -139,7 +141,7 @@ main (int argc, char *argv[]) switch (ACE_OS::fork (argv[0])) { - case -1: + case -1: return -1; case 0: diff --git a/examples/Reactor/Dgram/Dgram.cpp b/examples/Reactor/Dgram/Dgram.cpp index 8cc307d8fe1..09b4d1164a7 100644 --- a/examples/Reactor/Dgram/Dgram.cpp +++ b/examples/Reactor/Dgram/Dgram.cpp @@ -19,8 +19,8 @@ public: virtual int handle_input (ACE_HANDLE handle); - virtual int handle_timeout (const ACE_Time_Value & tv, - const void *arg = 0); + virtual int handle_timeout (const ACE_Time_Value & tv, + const void *arg = 0); }; AAL_CP::AAL_CP (const ACE_INET_Addr &local_addr) @@ -41,7 +41,7 @@ AAL_CP::handle_input (ACE_HANDLE) ACE_INET_Addr from_addr; ACE_DEBUG ((LM_DEBUG, "(%P|%t) activity occurred on handle %d!\n", - ACE_SOCK_Dgram::get_handle ())); + ACE_SOCK_Dgram::get_handle ())); ssize_t n = ACE_SOCK_Dgram::recv (buf, sizeof buf, from_addr); @@ -49,7 +49,7 @@ AAL_CP::handle_input (ACE_HANDLE) ACE_ERROR ((LM_ERROR, "%p\n", "handle_input")); else ACE_DEBUG ((LM_DEBUG, "(%P|%t) buf of size %d = %*s\n", n, n, buf)); - + return 0; } @@ -61,7 +61,7 @@ AAL_CP::handle_timeout (const ACE_Time_Value &, const void *) } static int -run_test (u_short localport, +run_test (u_short localport, const char *remotehost, u_short remoteport) { @@ -72,7 +72,7 @@ run_test (u_short localport, AAL_CP aal (local_addr); // Read data from other side. - if (ACE_Reactor::instance ()->register_handler + if (ACE_Reactor::instance ()->register_handler (&aal, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "ACE_Reactor::register_handler"), @@ -82,7 +82,7 @@ run_test (u_short localport, ACE_OS::strcpy (buf, "Data to transmit"); size_t len = ACE_OS::strlen (buf); - if (localport == port1) + if (localport == port1) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) sending data\n")); @@ -121,6 +121,8 @@ run_test (u_short localport, -1); ACE_DEBUG ((LM_DEBUG, "(%P|%t) exiting\n")); + + return 0; } int @@ -138,7 +140,7 @@ main (int argc, char *argv[]) switch (ACE_OS::fork (argv[0])) { - case -1: + case -1: return -1; case 0: |