diff options
author | Marc Laukien <marc@zeroc.com> | 2004-11-05 21:36:22 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-11-05 21:36:22 +0000 |
commit | 5b72607fa7e7d4e70d42a7455cb53c45ba6de66e (patch) | |
tree | b76e03b001d9efe399416533c965be6f4d14eed8 | |
parent | Added missing call to Process.Close(). (diff) | |
download | ice-5b72607fa7e7d4e70d42a7455cb53c45ba6de66e.tar.bz2 ice-5b72607fa7e7d4e70d42a7455cb53c45ba6de66e.tar.xz ice-5b72607fa7e7d4e70d42a7455cb53c45ba6de66e.zip |
fixes
-rw-r--r-- | cpp/demo/Glacier2/callback/config.glacier2 | 4 | ||||
-rw-r--r-- | cpp/src/Glacier2/Blobject.cpp | 91 | ||||
-rw-r--r-- | cpp/src/Glacier2/Blobject.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 4 | ||||
-rwxr-xr-x | cpp/test/Glacier2/router/run.py | 4 | ||||
-rwxr-xr-x | cs/src/Ice/PropertiesI.cs | 4 | ||||
-rw-r--r-- | java/src/Ice/PropertiesI.java | 4 |
8 files changed, 68 insertions, 53 deletions
diff --git a/cpp/demo/Glacier2/callback/config.glacier2 b/cpp/demo/Glacier2/callback/config.glacier2 index b1c441d9030..5fbcca01f52 100644 --- a/cpp/demo/Glacier2/callback/config.glacier2 +++ b/cpp/demo/Glacier2/callback/config.glacier2 @@ -52,8 +52,8 @@ Glacier2.SessionTimeout=30 # work either. Also, with unbuffered request forwarding, the caller # thread blocks for twoway requests. # -Glacier2.Client.Unbuffered=0 -Glacier2.Server.Unbuffered=0 +Glacier2.Client.Buffered=1 +Glacier2.Server.Buffered=1 # # These two lines instruct Glacier2 to forward contexts both for 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", diff --git a/cpp/test/Glacier2/router/run.py b/cpp/test/Glacier2/router/run.py index 131046d474c..99f3046607b 100755 --- a/cpp/test/Glacier2/router/run.py +++ b/cpp/test/Glacier2/router/run.py @@ -9,7 +9,7 @@ # ********************************************************************** import os, sys - +import time for toplevel in [".", "..", "../..", "../../..", "../../../.."]: toplevel = os.path.normpath(toplevel) if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): @@ -34,6 +34,8 @@ TestUtil.getServerPid(starterPipe) TestUtil.getAdapterReady(starterPipe) print "ok" +time.sleep(30) + name = os.path.join("Glacier2", "router") TestUtil.mixedClientServerTest(name) diff --git a/cs/src/Ice/PropertiesI.cs b/cs/src/Ice/PropertiesI.cs index d60397e5683..4abc84b3d72 100755 --- a/cs/src/Ice/PropertiesI.cs +++ b/cs/src/Ice/PropertiesI.cs @@ -625,7 +625,7 @@ namespace Ice "Client.Trace.Override", "Client.Trace.Reject", "Client.Trace.Request", - "Client.Unbuffered", + "Client.Buffered", "CryptPasswords", "PermissionsVerifier", "RouterIdentity", @@ -635,7 +635,7 @@ namespace Ice "Server.SleepTime", "Server.Trace.Override", "Server.Trace.Request", - "Server.Unbuffered", + "Server.Buffered", "SessionManager", "SessionTimeout", "Trace.RoutingTable", diff --git a/java/src/Ice/PropertiesI.java b/java/src/Ice/PropertiesI.java index 9f976707b04..14aaacd791f 100644 --- a/java/src/Ice/PropertiesI.java +++ b/java/src/Ice/PropertiesI.java @@ -617,7 +617,7 @@ final class PropertiesI extends LocalObjectImpl implements Properties "Client.Trace.Override", "Client.Trace.Reject", "Client.Trace.Request", - "Client.Unbuffered", + "Client.Buffered", "CryptPasswords", "PermissionsVerifier", "RouterIdentity", @@ -627,7 +627,7 @@ final class PropertiesI extends LocalObjectImpl implements Properties "Server.SleepTime", "Server.Trace.Override", "Server.Trace.Request", - "Server.Unbuffered", + "Server.Buffered", "SessionManager", "SessionTimeout", "Trace.RoutingTable", |