summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-31 22:09:00 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-31 22:09:00 +0000
commitd3ed246e9c73273f9bea73e7398721d6a340dfbd (patch)
tree769c822279d2b1102ab968fe00e7d528669d5473
parent42368a1ec154e85ac4a2dad81605f5093b1131bc (diff)
downloadATCD-d3ed246e9c73273f9bea73e7398721d6a340dfbd.tar.gz
adding DS library
-rw-r--r--modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.cpp3
-rw-r--r--modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.h2
-rw-r--r--modules/TAO/tao/Network_Priority_Protocols_Hooks.h5
-rw-r--r--modules/TAO/tao/Remote_Invocation.cpp28
4 files changed, 33 insertions, 5 deletions
diff --git a/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.cpp b/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.cpp
index ce2ab4b9e66..752b611bfcf 100644
--- a/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.cpp
+++ b/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.cpp
@@ -43,7 +43,8 @@ TAO_Default_Network_Priority_Protocols_Hooks::set_dscp_codepoint (CORBA::Long)
}
const CORBA::Long
-TAO_Default_Network_Priority_Protocols_Hooks::get_dscp_codepoint (void)
+TAO_Default_Network_Priority_Protocols_Hooks::get_dscp_codepoint (
+ TAO_Stub *, CORBA::Object *)
{
return 0;
}
diff --git a/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.h b/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.h
index a8198133d31..8d7f8036642 100644
--- a/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.h
+++ b/modules/TAO/tao/Default_Network_Priority_Protocols_Hooks.h
@@ -37,7 +37,7 @@ public:
void init_hooks (TAO_ORB_Core *orb_core);
- const CORBA::Long get_dscp_codepoint (void);
+ const CORBA::Long get_dscp_codepoint (TAO_Stub *stub, CORBA::Object *object);
void set_dscp_codepoint (CORBA::Long dscp_codepoint);
diff --git a/modules/TAO/tao/Network_Priority_Protocols_Hooks.h b/modules/TAO/tao/Network_Priority_Protocols_Hooks.h
index 0bbb7b43fe7..45ced9e189f 100644
--- a/modules/TAO/tao/Network_Priority_Protocols_Hooks.h
+++ b/modules/TAO/tao/Network_Priority_Protocols_Hooks.h
@@ -29,8 +29,8 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace CORBA
{
- class Policy;
class Environment;
+ class Object;
}
class TAO_ORB_Core;
@@ -47,7 +47,8 @@ public:
virtual void init_hooks (TAO_ORB_Core *orb_core) = 0;
- virtual const CORBA::Long get_dscp_codepoint (void) = 0;
+ virtual const CORBA::Long get_dscp_codepoint (TAO_Stub *stub,
+ CORBA::Object *object) = 0;
virtual void set_dscp_codepoint (CORBA::Long dscp_codepoint) = 0;
diff --git a/modules/TAO/tao/Remote_Invocation.cpp b/modules/TAO/tao/Remote_Invocation.cpp
index 10c0805d385..2fdffbbfb5d 100644
--- a/modules/TAO/tao/Remote_Invocation.cpp
+++ b/modules/TAO/tao/Remote_Invocation.cpp
@@ -9,6 +9,7 @@
#include "tao/operation_details.h"
#include "tao/ORB_Core.h"
#include "tao/Protocols_Hooks.h"
+#include "tao/Network_Priority_Protocols_Hooks.h"
#include "tao/debug.h"
ACE_RCSID (tao,
@@ -133,9 +134,16 @@ namespace TAO
short message_semantics,
ACE_Time_Value *max_wait_time)
{
+ // The protocols hooks could be the Default implementation
+ // or the RT CORBA implementation of the Protocols Hooks.
+ //
TAO_Protocols_Hooks *tph =
this->resolver_.stub ()->orb_core ()->get_protocols_hooks ();
+ // This boolean value will be set only when RTCORBA is used
+ // and the enable_network_priority flag is set to 1 in the
+ // RTCORBA Protocols Properties.
+ //
CORBA::Boolean const set_client_network_priority =
tph->set_client_network_priority (this->resolver_.transport ()->tag (),
this->resolver_.stub ());
@@ -143,7 +151,25 @@ namespace TAO
TAO_Connection_Handler *connection_handler =
this->resolver_.transport ()->connection_handler ();
- connection_handler->set_dscp_codepoint (set_client_network_priority);
+ if (set_client_network_priority)
+ {
+ // RTCORBA is used and the RTCORBA way of setting DiffServ codepoints
+ // is supported.
+ //
+ connection_handler->set_dscp_codepoint (set_client_network_priority);
+ }
+ else
+ {
+ // RTCORBA may or may not be used. Check if DiffServ policy is used
+ // to set the diffserv codepoints to be used.
+ // Either CLIENT_PROPAGATED or SERVER_DECLARED models could be used.
+ TAO_Network_Priority_Protocols_Hooks *nph =
+ this->resolver_.stub ()->orb_core ()->
+ get_network_priority_protocols_hooks ();
+ CORBA::Long dscp = nph->get_dscp_codepoint (this->resolver_.stub (),
+ this->resolver_.object ());
+ connection_handler->set_dscp_codepoint (dscp);
+ }
int const retval =
this->resolver_.transport ()->send_request (