summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp107
1 files changed, 25 insertions, 82 deletions
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
index ec367a37450..d69fb1b06a1 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
@@ -3,12 +3,9 @@
// $Id$
#include "SSLIOP_Transport.h"
-
#include "tao/debug.h"
-ACE_RCSID (TAO_SSLIOP,
- SSLIOP_Transport,
- "$Id$")
+ACE_RCSID (TAO_SSLIOP, SSLIOP_Transport, "$Id$")
#include "SSLIOP_Connection_Handler.h"
#include "SSLIOP_Profile.h"
@@ -72,74 +69,16 @@ TAO_SSLIOP_Transport::messaging_object (void)
ssize_t
-TAO_SSLIOP_Transport::send_i (const ACE_Message_Block *message_block,
- const ACE_Time_Value *max_wait_time,
- size_t *bt)
+TAO_SSLIOP_Transport::send_i (iovec *iov, int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *max_wait_time)
{
- // @@ This code should be refactored into ACE.cpp or something
- // similar!
-
- // For the most part this was copied from GIOP::send_request and
- // friends.
-
- size_t temp;
- size_t &bytes_transferred = bt == 0 ? temp : *bt;
-
- iovec iov[IOV_MAX];
- int iovcnt = 0;
- ssize_t n = 0;
-
- for (const ACE_Message_Block *i = message_block;
- i != 0;
- i = i->cont ())
- {
- // Make sure there is something to send!
- if (i->length () > 0)
- {
- iov[iovcnt].iov_base = i->rd_ptr ();
- iov[iovcnt].iov_len = i->length ();
- iovcnt++;
-
- // The buffer is full make a OS call. @@ TODO this should
- // be optimized on a per-platform basis, for instance, some
- // platforms do not implement writev() there we should copy
- // the data into a buffer and call send_n(). In other cases
- // there may be some limits on the size of the iovec, there
- // we should set IOV_MAX to that limit.
- if (iovcnt == IOV_MAX)
- {
- if (max_wait_time == 0)
- n = this->connection_handler_->peer ().sendv_n (iov,
- iovcnt);
- else
- // @@ No timeouts!!!
- n = this->connection_handler_->peer ().sendv_n (iov,
- iovcnt /*,
- max_wait_time */);
-
- if (n == 0 ||
- n == -1)
- return n;
-
- bytes_transferred += n;
- iovcnt = 0;
- }
- }
- }
-
- // Check for remaining buffers to be sent!
- if (iovcnt != 0)
- {
- n = this->connection_handler_->peer ().sendv_n (iov,
- iovcnt);
- if (n == 0 ||
- n == -1)
- return n;
-
- bytes_transferred += n;
- }
+ ssize_t retval = this->connection_handler_->peer ().send (iov, iovcnt,
+ max_wait_time);
+ if (retval > 0)
+ bytes_transferred = retval;
- return bytes_transferred;
+ return retval;
}
ssize_t
@@ -191,6 +130,21 @@ TAO_SSLIOP_Transport::read_process_message (ACE_Time_Value *max_wait_time,
int
TAO_SSLIOP_Transport::register_handler_i (void)
{
+ if (TAO_debug_level > 4)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - IIOP_Transport::register_handler %d\n",
+ this->id ()));
+ }
+ if (this->connection_handler_->is_registered ())
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - IIOP_Transport::register_handler %d"
+ ", already registered\n",
+ this->id ()));
+ return 0;
+ }
+
// @@ It seems like this method should go away, the right reactor is
// picked at object creation time.
ACE_Reactor *r = this->orb_core_->reactor ();
@@ -244,7 +198,7 @@ TAO_SSLIOP_Transport::send_message (TAO_OutputCDR &stream,
// versions seem to need it though. Leaving it costs little.
// This guarantees to send all data (bytes) or return an error.
- ssize_t n = this->send_or_buffer (stub,
+ ssize_t n = this->send_message_i (stub,
twoway,
stream.begin (),
max_wait_time);
@@ -260,17 +214,6 @@ TAO_SSLIOP_Transport::send_message (TAO_OutputCDR &stream,
return -1;
}
- // EOF.
- if (n == 0)
- {
- if (TAO_debug_level)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO: (%P|%t|%N|%l) send_message () \n")
- ACE_TEXT ("EOF, closing transport %d\n"),
- this->id ()));
- return -1;
- }
-
return 1;
}