summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2001-05-14 20:43:49 +0000
committerbala <balanatarajan@users.noreply.github.com>2001-05-14 20:43:49 +0000
commitb301ef71a13710fe992fbf04e6c82736bce7272b (patch)
treec88315ed4c86858c1823744e72a698c8634a552b
parentc4073dba4f33a6a9a35c86392d86047e52230c37 (diff)
downloadATCD-b301ef71a13710fe992fbf04e6c82736bce7272b.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/GIOP_Message_Reactive_Handler.h2
-rw-r--r--TAO/tao/GIOP_Message_State.cpp4
-rw-r--r--TAO/tao/GIOP_Message_State.h9
-rw-r--r--TAO/tao/GIOP_Message_State.i8
-rw-r--r--TAO/tao/Strategies/GIOP_Message_NonReactive_Base.cpp32
-rw-r--r--TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.cpp16
-rw-r--r--TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.h5
-rw-r--r--TAO/tao/Strategies/SHMIOP_Transport.cpp19
-rw-r--r--TAO/tao/Strategies/SHMIOP_Transport.h6
-rw-r--r--TAO/tao/Transport.cpp29
-rw-r--r--TAO/tao/Transport.h33
11 files changed, 66 insertions, 97 deletions
diff --git a/TAO/tao/GIOP_Message_Reactive_Handler.h b/TAO/tao/GIOP_Message_Reactive_Handler.h
index 70213bd53d3..b38a74c27c5 100644
--- a/TAO/tao/GIOP_Message_Reactive_Handler.h
+++ b/TAO/tao/GIOP_Message_Reactive_Handler.h
@@ -54,7 +54,7 @@ enum TAO_GIOP_Message_Status
* reading the header and the payload seperately.
*/
-class TAO_GIOP_Message_Reactive_Handler
+class TAO_Export TAO_GIOP_Message_Reactive_Handler
{
public:
diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp
index 85e2ad53f87..c71c5a638e5 100644
--- a/TAO/tao/GIOP_Message_State.cpp
+++ b/TAO/tao/GIOP_Message_State.cpp
@@ -14,12 +14,12 @@ ACE_RCSID(tao, GIOP_Message_State, "$Id$")
TAO_GIOP_Message_State::TAO_GIOP_Message_State (TAO_ORB_Core* /*orb_core*/)
: byte_order (TAO_ENCAP_BYTE_ORDER),
- more_fragments (0),
message_type (TAO_GIOP_MESSAGERROR),
message_size (0),
request_id (0),
// Problem similar to GIOP_Message_handler.cpp - Bala
- fragmented_messages (ACE_CDR::DEFAULT_BUFSIZE)
+ fragmented_messages (ACE_CDR::DEFAULT_BUFSIZE),
+ more_fragments (0)
{
//giop_version.major = TAO_DEF_GIOP_MAJOR;
//giop_version.minor = TAO_DEF_GIOP_MINOR;
diff --git a/TAO/tao/GIOP_Message_State.h b/TAO/tao/GIOP_Message_State.h
index 336fad01a88..2a5f349b31f 100644
--- a/TAO/tao/GIOP_Message_State.h
+++ b/TAO/tao/GIOP_Message_State.h
@@ -97,15 +97,15 @@ public:
/// if required...
int is_complete (ACE_Message_Block &current_buf);
+ /// Did we get fragmented messages?
+ int message_fragmented (void);
+
/// Version info
TAO_GIOP_Version giop_version;
/// 0 = big, 1 = little
CORBA::Octet byte_order;
- /// (Requests and Replys)
- CORBA::Octet more_fragments;
-
/// MsgType above
CORBA::Octet message_type;
@@ -149,12 +149,15 @@ public:
*/
CORBA::Octet first_fragment_message_type;
+ /// (Requests and Replys)
+ CORBA::Octet more_fragments;
private:
/// Append <current> to the list of fragments
/// Also resets the state, because the current message was consumed.
int append_fragment (ACE_Message_Block &current);
+
};
diff --git a/TAO/tao/GIOP_Message_State.i b/TAO/tao/GIOP_Message_State.i
index b51ac281369..79502276d97 100644
--- a/TAO/tao/GIOP_Message_State.i
+++ b/TAO/tao/GIOP_Message_State.i
@@ -66,6 +66,14 @@ TAO_GIOP_Version::operator!= (const TAO_GIOP_Version &src)
//
// Inlined methods for TAO_GIOP_Message_State
//
+int
+TAO_GIOP_Message_State::message_fragmented (void)
+{
+ if (this->more_fragments)
+ return 1;
+
+ return 0;
+}
ACE_INLINE void
TAO_GIOP_Message_State::reset (int /*reset_contents*/)
diff --git a/TAO/tao/Strategies/GIOP_Message_NonReactive_Base.cpp b/TAO/tao/Strategies/GIOP_Message_NonReactive_Base.cpp
index a8a2fae1bd7..8c6761de3e1 100644
--- a/TAO/tao/Strategies/GIOP_Message_NonReactive_Base.cpp
+++ b/TAO/tao/Strategies/GIOP_Message_NonReactive_Base.cpp
@@ -110,6 +110,36 @@ TAO_GIOP_Message_NonReactive_Base::process_reply_message (
int
TAO_GIOP_Message_NonReactive_Base::more_messages (void)
{
+ if (this->message_handler_.message_state ().message_fragmented ())
+ {
+ // We have fragmented message
+ // Get the message block from the handler
+ ACE_Message_Block *mesg_block =
+ this->message_handler_.input_cdr ().steal_contents ();
+
+ // Send the message block for patching with the right info.
+ int retval =
+ this->message_handler_.message_state ().is_complete (*mesg_block);
+
+ // Get the read and write pointers of the message block
+ size_t rd_pos =
+ mesg_block->rd_ptr () - mesg_block->base ();
+
+ size_t wr_pos =
+ mesg_block->wr_ptr () - mesg_block->base ();
+
+ // Create a new InputCDR stream
+ TAO_InputCDR cdr (mesg_block->data_block (),
+ rd_pos,
+ wr_pos);
+
+ this->message_handler_.input_cdr ().exchange_data_blocks (cdr);
+
+ return retval;
+ }
+
+
+
///@@@
- return 0;
+ return 1;
}
diff --git a/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.cpp b/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.cpp
index 13752ef6b42..1e8fa4a9252 100644
--- a/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.cpp
+++ b/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.cpp
@@ -3,13 +3,12 @@
#include "tao/ORB_Core.h"
#include "tao/CDR.h"
#include "tao/debug.h"
-
+#include "tao/Transport.h"
#if !defined (__ACE_INLINE__)
# include "GIOP_Message_NonReactive_Handler.inl"
#endif /* __ACE_INLINE__ */
-
ACE_RCSID (tao, GIOP_Message_NonReactive_Handler, "$Id$")
@@ -141,9 +140,16 @@ TAO_GIOP_Message_NonReactive_Handler::read_message (TAO_Transport *transport,
n != 0;
n -= bytes)
{
- bytes = transport->recv_n (buf,
- n,
- max_wait_time);
+ // We would have liked to use something like a recv_n ()
+ // here. But at the time when the code was written, the MEM_Stream
+ // classes had poor support for recv_n (). Till a day when we
+ // get proper recv_n (), let us stick with this. The other
+ // argument that can be said against this is that, this is the
+ // bad layer in which this is being done ie. recv_n is
+ // simulated. But...
+ bytes = transport->recv (buf,
+ n,
+ max_wait_time);
// @@ Do we need to check for errno != EWOULDBLOCK?? and errno ==
// @@ ECONNRESET. Does such things make sense here??
diff --git a/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.h b/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.h
index a47f475b63e..fee6f6dd55d 100644
--- a/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.h
+++ b/TAO/tao/Strategies/GIOP_Message_NonReactive_Handler.h
@@ -14,12 +14,13 @@
#define TAO_GIOP_MESSAGE_NON_REACTIVE_HANDLER_H
#include "ace/pre.h"
-#include "tao/CDR.h"
+#include "strategies_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/CDR.h"
#include "tao/GIOP_Message_Reactive_Handler.h"
class TAO_Transport;
@@ -43,7 +44,7 @@ class TAO_GIOP_Message_NonReactive_Base;
* higher level??
*/
-class TAO_GIOP_Message_NonReactive_Handler : public TAO_GIOP_Message_Reactive_Handler
+class TAO_Strategies_Export TAO_GIOP_Message_NonReactive_Handler : public TAO_GIOP_Message_Reactive_Handler
{
public:
diff --git a/TAO/tao/Strategies/SHMIOP_Transport.cpp b/TAO/tao/Strategies/SHMIOP_Transport.cpp
index 2a6a0b61186..1c1008138c0 100644
--- a/TAO/tao/Strategies/SHMIOP_Transport.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Transport.cpp
@@ -96,7 +96,6 @@ TAO_SHMIOP_Transport::recv_i (char *buf,
max_wait_time);
}
-
int
TAO_SHMIOP_Transport::read_process_message (ACE_Time_Value *max_wait_time,
int block)
@@ -123,14 +122,9 @@ TAO_SHMIOP_Transport::read_process_message (ACE_Time_Value *max_wait_time,
// here.. We loop here to see whether we have read more than one
// message in our read.
- // Set the result state
- result = 1;
-
// See we use the reactor semantics again
- while (result > 0)
- {
- result = this->process_message ();
- }
+ result = this->process_message ();
+
return result;
}
@@ -227,18 +221,13 @@ TAO_SHMIOP_Transport::messaging_init (CORBA::Octet major,
}
int
-TAO_SHMIOP_Transport::reactor_signalling (void)
-{
- return 1;
-}
-
-int
TAO_SHMIOP_Transport::process_message (void)
{
// Check whether we have messages for processing
int retval =
this->messaging_object_->more_messages ();
+ // The messages are fragmented, so we go back to the reactor.
if (retval <= 0)
return retval;
@@ -349,7 +338,7 @@ TAO_SHMIOP_Transport::process_message (void)
return -1;
}
- return 1;
+ return 0;
}
void
diff --git a/TAO/tao/Strategies/SHMIOP_Transport.h b/TAO/tao/Strategies/SHMIOP_Transport.h
index ead847e0e5a..60812057b5b 100644
--- a/TAO/tao/Strategies/SHMIOP_Transport.h
+++ b/TAO/tao/Strategies/SHMIOP_Transport.h
@@ -108,12 +108,6 @@ public:
virtual int messaging_init (CORBA::Octet major,
CORBA::Octet minor);
- /// Indicates whether the reactor is used by the protocol for
- /// signalling.
- virtual int reactor_signalling (void);
-
- //@}
-
private:
/// Process the message that we have read
int process_message (void);
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index bf8f63fb490..ac1fc240872 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -552,11 +552,6 @@ TAO_Transport::tear_listen_point_list (TAO_InputCDR &)
ACE_NOTSUP_RETURN (-1);
}
-int
-TAO_Transport::reactor_signalling (void)
-{
- return 0;
-}
void
TAO_Transport::connection_handler_closing (void)
@@ -717,30 +712,6 @@ TAO_Transport::recv (char *buffer,
return this->recv_i (buffer, len, timeout);
}
-ssize_t
-TAO_Transport::recv_n (char *buffer,
- size_t len,
- const ACE_Time_Value *timeout)
-{
- ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
- guard,
- *this->handler_lock_,
- -1));
-
- if (this->check_event_handler_i ("TAO_Transport::recv") == -1)
- return -1;
-
- // now call the template method
- return this->recv_n_i (buffer, len, timeout);
-}
-
-ssize_t
-TAO_Transport::recv_n_i (char *buffer,
- size_t len,
- const ACE_Time_Value *timeout)
-{
-
-}
int
TAO_Transport::generate_locate_request (
diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h
index 77f7c4b1c40..c838e23f209 100644
--- a/TAO/tao/Transport.h
+++ b/TAO/tao/Transport.h
@@ -330,20 +330,6 @@ public:
size_t len,
const ACE_Time_Value *timeout = 0);
- /// Read len bytes from into buf, by calling recv_n
- /**
- * This method serializes on handler_lock_, guaranteeing that only
- * thread can execute it on the same instance concurrently.
- *
- * @param buffer ORB allocated buffer where the data should be
- * @@ The ACE_Time_Value *s is just a place holder for now. It is
- * not clear this this is the best place to specify this. The actual
- * timeout values will be kept in the Policies.
- */
- ssize_t recv_n (char *buffer,
- size_t len,
- const ACE_Time_Value *timeout = 0);
-
/// Return the identifier for this transport instance.
/**
@@ -434,17 +420,6 @@ protected:
size_t len,
const ACE_Time_Value *timeout = 0) = 0;
- // Read len bytes from into buf, by calling recv_n ()
- /**
- * @param buffer ORB allocated buffer where the data should be
- * @@ The ACE_Time_Value *s is just a place holder for now. It is
- * not clear this this is the best place to specify this. The actual
- * timeout values will be kept in the Policies.
- */
- virtual ssize_t recv_n_i (char *buffer,
- size_t len,
- const ACE_Time_Value *timeout = 0);
-
public:
/// This is a request for the transport object to write a
@@ -557,14 +532,6 @@ protected:
virtual void transition_handler_state_i (void) = 0;
public:
- /// Indicates whether the reactor is used by the protocol for
- /// signalling.
- /**
- * @todo: This method needs to go. This is part of the hack for
- * making SHMIOP work at the last minute for TAO 1.1.13
- */
- virtual int reactor_signalling (void);
-
/// Method for the connection handler to signify that it
/// is being closed and destroyed.
virtual void connection_handler_closing (void);