diff options
author | Steve Huston <shuston@riverace.com> | 2002-06-03 15:51:36 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2002-06-03 15:51:36 +0000 |
commit | aac111b5f6e999088454713a189d11ae9ee333f5 (patch) | |
tree | 1afa8d3f5f8ab8ed4c40692c99771e30b607c777 /examples | |
parent | 09c64af810c888ef041a3dcfea06e249ea992e9c (diff) | |
download | ATCD-aac111b5f6e999088454713a189d11ae9ee333f5.tar.gz |
Fix forward() per Alain.Fix forward() per Alain.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/C++NPv2/Client_Logging_Daemon.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/C++NPv2/Client_Logging_Daemon.cpp b/examples/C++NPv2/Client_Logging_Daemon.cpp index f4290cc66c4..9571c5abdea 100644 --- a/examples/C++NPv2/Client_Logging_Daemon.cpp +++ b/examples/C++NPv2/Client_Logging_Daemon.cpp @@ -152,13 +152,16 @@ void *CLD_Handler::forward () { ACE_Message_Block *blocks[ACE_IOV_MAX]; size_t message_index = 0; ACE_Time_Value time_of_last_send (ACE_OS::gettimeofday ()); + ACE_Time_Value timeout; ACE_Sig_Action no_sigpipe ((ACE_SignalHandler) SIG_IGN); ACE_Sig_Action original_action; no_sigpipe.register_action (SIGPIPE, &original_action); - ACE_Time_Value timeout (ACE_OS::gettimeofday ()); - timeout += FLUSH_TIMEOUT; for (;;) { + if (message_index == 0) { + timeout = ACE_OS::gettimeofday (); + timeout += FLUSH_TIMEOUT; + } ACE_Message_Block *mblk = 0; if (msg_queue_.dequeue_head (mblk, &timeout) == -1) { if (errno != EWOULDBLOCK) break; @@ -175,8 +178,6 @@ void *CLD_Handler::forward () { >= FLUSH_TIMEOUT)) { if (send (blocks, message_index) == -1) break; time_of_last_send = ACE_OS::gettimeofday (); - ACE_Time_Value timeout (ACE_OS::gettimeofday ()); - timeout += FLUSH_TIMEOUT; } } |