summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2004-11-05 21:36:22 +0000
committerMarc Laukien <marc@zeroc.com>2004-11-05 21:36:22 +0000
commit5b72607fa7e7d4e70d42a7455cb53c45ba6de66e (patch)
treeb76e03b001d9efe399416533c965be6f4d14eed8 /cpp/src
parentAdded missing call to Process.Close(). (diff)
downloadice-5b72607fa7e7d4e70d42a7455cb53c45ba6de66e.tar.bz2
ice-5b72607fa7e7d4e70d42a7455cb53c45ba6de66e.tar.xz
ice-5b72607fa7e7d4e70d42a7455cb53c45ba6de66e.zip
fixes
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/Blobject.cpp91
-rw-r--r--cpp/src/Glacier2/Blobject.h2
-rw-r--r--cpp/src/Ice/ConnectionI.cpp8
-rw-r--r--cpp/src/Ice/PropertiesI.cpp4
4 files changed, 59 insertions, 46 deletions
diff --git a/cpp/src/Glacier2/Blobject.cpp b/cpp/src/Glacier2/Blobject.cpp
index 1d9e93bf440..bf4ea5deefb 100644
--- a/cpp/src/Glacier2/Blobject.cpp
+++ b/cpp/src/Glacier2/Blobject.cpp
@@ -15,8 +15,8 @@ using namespace Glacier2;
static const string serverForwardContext = "Glacier2.Server.ForwardContext";
static const string clientForwardContext = "Glacier2.Client.ForwardContext";
-static const string serverUnbuffered = "Glacier2.Server.Unbuffered";
-static const string clientUnbuffered = "Glacier2.Client.Unbuffered";
+static const string serverBuffered = "Glacier2.Server.Buffered";
+static const string clientBuffered = "Glacier2.Client.Buffered";
static const string serverAlwaysBatch = "Glacier2.Server.AlwaysBatch";
static const string clientAlwaysBatch = "Glacier2.Client.AlwaysBatch";
static const string serverTraceRequest = "Glacier2.Server.Trace.Request";
@@ -34,9 +34,9 @@ Glacier2::Blobject::Blobject(const CommunicatorPtr& communicator, bool reverse)
_forwardContext(_reverse ?
_properties->getPropertyAsInt(serverForwardContext) > 0 :
_properties->getPropertyAsInt(clientForwardContext) > 0),
- _unbuffered(_reverse ?
- _properties->getPropertyAsInt(serverUnbuffered) > 0 :
- _properties->getPropertyAsInt(clientUnbuffered) > 0),
+ _buffered(_reverse ?
+ _properties->getPropertyAsIntWithDefault(serverBuffered, 1) > 0 :
+ _properties->getPropertyAsIntWithDefault(clientBuffered, 1) > 0),
_alwaysBatch(_reverse ?
_properties->getPropertyAsInt(serverAlwaysBatch) > 0 :
_properties->getPropertyAsInt(clientAlwaysBatch) > 0),
@@ -47,7 +47,7 @@ Glacier2::Blobject::Blobject(const CommunicatorPtr& communicator, bool reverse)
_properties->getPropertyAsInt(serverTraceOverride) :
_properties->getPropertyAsInt(clientTraceOverride))
{
- if(!_unbuffered)
+ if(_buffered)
{
try
{
@@ -127,7 +127,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
case 'o':
{
- if(_alwaysBatch && !_unbuffered)
+ if(_alwaysBatch && _buffered)
{
proxy = proxy->ice_batchOneway();
}
@@ -140,7 +140,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
case 'd':
{
- if(_alwaysBatch && !_unbuffered)
+ if(_alwaysBatch && _buffered)
{
proxy = proxy->ice_batchDatagram();
}
@@ -153,7 +153,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
case 'O':
{
- if(!_unbuffered)
+ if(_buffered)
{
proxy = proxy->ice_batchOneway();
}
@@ -166,7 +166,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
case 'D':
{
- if(!_unbuffered)
+ if(_buffered)
{
proxy = proxy->ice_batchDatagram();
}
@@ -207,9 +207,13 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
out << "reverse ";
}
out << "routing";
- if(_unbuffered)
+ if(_buffered)
{
- out << " (unbuffered)";
+ out << " (buffered)";
+ }
+ else
+ {
+ out << " (not buffered)";
}
out << "\nproxy = " << _communicator->proxyToString(proxy);
out << "\noperation = " << current.operation;
@@ -225,39 +229,12 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
}
}
- if(_unbuffered)
- {
- //
- // If we are in unbuffered mode, we send the request directly.
- //
-
- bool ok;
- vector<Byte> outParams;
-
- try
- {
- if(_forwardContext)
- {
- ok = proxy->ice_invoke(current.operation, current.mode, inParams, outParams, current.ctx);
- }
- else
- {
- ok = proxy->ice_invoke(current.operation, current.mode, inParams, outParams);
- }
-
- amdCB->ice_response(ok, outParams);
- }
- catch(const LocalException& ex)
- {
- amdCB->ice_exception(ex);
- }
- }
- else
+ if(_buffered)
{
//
- // If we are not in unbuffered mode, we create a new request
- // and add it to the request queue. If the request is twoway,
- // we use AMI.
+ // If we are in buffered mode, we create a new request and add
+ // it to the request queue. If the request is twoway, we use
+ // AMI.
//
bool override = _requestQueue->addRequest(new Request(proxy, inParams, current, _forwardContext, amdCB));
@@ -284,4 +261,32 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd
}
}
}
+ else
+ {
+ //
+ // If we are in not in buffered mode, we send the request
+ // directly.
+ //
+
+ bool ok;
+ vector<Byte> outParams;
+
+ try
+ {
+ if(_forwardContext)
+ {
+ ok = proxy->ice_invoke(current.operation, current.mode, inParams, outParams, current.ctx);
+ }
+ else
+ {
+ ok = proxy->ice_invoke(current.operation, current.mode, inParams, outParams);
+ }
+
+ amdCB->ice_response(ok, outParams);
+ }
+ catch(const LocalException& ex)
+ {
+ amdCB->ice_exception(ex);
+ }
+ }
}
diff --git a/cpp/src/Glacier2/Blobject.h b/cpp/src/Glacier2/Blobject.h
index 83f95226def..da286c7be8e 100644
--- a/cpp/src/Glacier2/Blobject.h
+++ b/cpp/src/Glacier2/Blobject.h
@@ -38,7 +38,7 @@ private:
const bool _reverse;
const bool _forwardContext;
- const bool _unbuffered;
+ const bool _buffered;
const bool _alwaysBatch;
const int _requestTraceLevel;
const int _overrideTraceLevel;
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index 492bb72c398..f04b074367f 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -38,6 +38,14 @@ Ice::ConnectionI::validate()
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ if(_threadPerConnection->getThreadControl() != IceUtil::ThreadControl())
+ {
+ cout << "_threadPerConnection->getThreadControl() != IceUtil::ThreadControl()" << endl;
+ }
+ else
+ {
+ cout << "_threadPerConnection->getThreadControl() == IceUtil::ThreadControl()" << endl;
+ }
if(_instance->threadPerConnection() &&
_threadPerConnection->getThreadControl() != IceUtil::ThreadControl())
{
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index ea89142479d..9f760d433ca 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -348,7 +348,7 @@ static const string glacier2Props[] =
"Client.Trace.Override",
"Client.Trace.Reject",
"Client.Trace.Request",
- "Client.Unbuffered",
+ "Client.Buffered",
"CryptPasswords",
"PermissionsVerifier",
"RouterIdentity",
@@ -358,7 +358,7 @@ static const string glacier2Props[] =
"Server.SleepTime",
"Server.Trace.Override",
"Server.Trace.Request",
- "Server.Unbuffered",
+ "Server.Buffered",
"SessionManager",
"SessionTimeout",
"Trace.RoutingTable",