diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-04 05:08:51 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-04 05:08:51 +0000 |
commit | bf5a912a0260690dac50de3a4e9d71c940199b5c (patch) | |
tree | 7cc3ba0ce90f6d260abcbf4e4efcd8db558bae6a /examples | |
parent | 2e964ca722de84386b053b5b0c0c44c2ec644fb5 (diff) | |
download | ATCD-bf5a912a0260690dac50de3a4e9d71c940199b5c.tar.gz |
*** empty log message ***
Diffstat (limited to 'examples')
-rw-r--r-- | examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp | 16 | ||||
-rw-r--r-- | examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp | 6 |
2 files changed, 17 insertions, 5 deletions
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp index c02b05b2cce..1b0321d877a 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp @@ -317,7 +317,7 @@ Twoway_Handler::run (void) for (;;) { ACE_INT32 len = 0; - char *request; + char *request = 0; if (parse_header_and_allocate_buffer (request, &len) == -1) @@ -349,7 +349,7 @@ Twoway_Handler::run (void) "ACE::write_n")); else { - size_t s_bytes = OPTIONS::instance ()->reply_message_len (); + ssize_t s_bytes = (ssize_t) OPTIONS::instance ()->reply_message_len (); // Don't try to send more than is in the request buffer! if (s_bytes > r_bytes) @@ -363,8 +363,12 @@ Twoway_Handler::run (void) } this->total_bytes_ += size_t (r_bytes); this->message_count_++; + + delete [] request; + request = 0; } + delete [] request; return 0; } @@ -403,7 +407,7 @@ Oneway_Handler::run (void) for (;;) { ACE_INT32 len = 0; - char *request; + char *request = 0; if (parse_header_and_allocate_buffer (request, &len) == -1) @@ -436,7 +440,11 @@ Oneway_Handler::run (void) this->total_bytes_ += size_t (r_bytes); this->message_count_++; + delete [] request; + request = 0; } + + delete [] request; return 0; } @@ -595,6 +603,8 @@ main (int argc, char *argv[]) #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Singleton<Options, ACE_SYNCH_RECURSIVE_MUTEX>; +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Singleton<Options, ACE_SYNCH_RECURSIVE_MUTEX> +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp index 856eb60a568..3cb94dfeec8 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp @@ -64,7 +64,7 @@ twoway_server (void *arg) size_t total_bytes = 0; size_t message_count = 0; - char *request; + char *request = 0; // Read data from client (terminate on error). @@ -135,6 +135,7 @@ twoway_server (void *arg) message_count++; delete [] request; + request = 0; } // Close new endpoint (listening endpoint stays open). @@ -179,7 +180,7 @@ oneway_server (void *arg) size_t total_bytes = 0; size_t message_count = 0; - char *request; + char *request = 0; // Read data from client (terminate on error). @@ -244,6 +245,7 @@ oneway_server (void *arg) message_count++; delete [] request; + request = 0; } timer.stop (); |