diff options
author | fields_t <fields_t@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-02-26 17:12:20 +0000 |
---|---|---|
committer | fields_t <fields_t@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-02-26 17:12:20 +0000 |
commit | 0697a969e89ed9686242abe8e9de8aacb75fe473 (patch) | |
tree | 924164f6133bccb233d8b0ef69b5946eb9cd12eb /TAO/tao/Transport.cpp | |
parent | 949adae660ede25bec09ab511443d0100eeecf13 (diff) | |
download | ATCD-0697a969e89ed9686242abe8e9de8aacb75fe473.tar.gz |
Thu Feb 26 10:10:40 MST 2004 Trevor Fields <fields_t@ociweb.com>
Diffstat (limited to 'TAO/tao/Transport.cpp')
-rw-r--r-- | TAO/tao/Transport.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 78d9095c07b..7b0a0ce4bc6 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -116,6 +116,8 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag, , handler_lock_ (orb_core->resource_factory ()->create_cached_connection_lock ()) , id_ ((size_t) this) , purging_order_ (0) + , recv_buffer_size_ (0) + , sent_byte_count_ (0) , char_translator_ (0) , wchar_translator_ (0) , tcs_set_ (0) @@ -739,6 +741,9 @@ TAO_Transport::drain_queue_helper (int &iovcnt, iovec iov[]) // no bytes are sent send() can only return 0 or -1 ACE_ASSERT (byte_count != 0); + // Total no. of bytes sent for a send call + this->sent_byte_count_ += byte_count; + if (TAO_debug_level > 4) { ACE_DEBUG ((LM_DEBUG, @@ -762,6 +767,10 @@ TAO_Transport::drain_queue_i (void) // We loop over all the elements in the queue ... TAO_Queued_Message *i = this->head_; + // reset the value so that the counting is done for each new send + // call. + this->sent_byte_count_ = 0; + while (i != 0) { // ... each element fills the iovector ... @@ -1197,6 +1206,13 @@ TAO_Transport::handle_input (TAO_Resume_Handle &rh, this->messaging_object ()->header_length (); } + // Saving the size of the received buffer in case any one needs to + // get the size of the message thats received in the + // context. Obviously the value will be changed for each recv call + // and the user is supposed to invoke the accessor only in the + // invocation context to get meaningful information. + this->recv_buffer_size_ = recv_size; + // Read the message into the message block that we have created on // the stack. ssize_t n = this->recv (message_block.rd_ptr (), @@ -1995,6 +2011,18 @@ TAO_Transport::transport_cache_manager (void) return this->orb_core_->lane_resources ().transport_cache (); } +size_t +TAO_Transport::recv_buffer_size (void) +{ + return this->recv_buffer_size_; +} + +size_t +TAO_Transport::sent_byte_count (void) +{ + return this->sent_byte_count_; +} + void TAO_Transport::assign_translators (TAO_InputCDR *inp, TAO_OutputCDR *outp) { |