diff options
author | Marc Laukien <marc@zeroc.com> | 2002-01-15 17:59:10 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-01-15 17:59:10 +0000 |
commit | 18752297f2d74b09bec84b1bf8ef10c2c89e00fb (patch) | |
tree | 9ae5e01fabf39c3a8f886297b44d4696f3db4bdb /cpp | |
parent | callback demo (diff) | |
download | ice-18752297f2d74b09bec84b1bf8ef10c2c89e00fb.tar.bz2 ice-18752297f2d74b09bec84b1bf8ef10c2c89e00fb.tar.xz ice-18752297f2d74b09bec84b1bf8ef10c2c89e00fb.zip |
_fwd stuff
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/demo/Ice/callback/Client.cpp | 37 | ||||
-rw-r--r-- | cpp/demo/Ice/callback/config | 2 | ||||
-rw-r--r-- | cpp/demo/Ice/callback/config.server | 2 | ||||
-rw-r--r-- | cpp/slice/Ice/Current.ice | 8 | ||||
-rw-r--r-- | cpp/src/Glacier/ClientBlobject.cpp | 44 | ||||
-rw-r--r-- | cpp/src/Glacier/ServerBlobject.cpp | 42 | ||||
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 1 |
7 files changed, 113 insertions, 23 deletions
diff --git a/cpp/demo/Ice/callback/Client.cpp b/cpp/demo/Ice/callback/Client.cpp index a2b24678430..55b6763c7e4 100644 --- a/cpp/demo/Ice/callback/Client.cpp +++ b/cpp/demo/Ice/callback/Client.cpp @@ -69,12 +69,18 @@ CallbackClient::run(int argc, char* argv[]) CallbackPrx batchDatagram = CallbackPrx::uncheckedCast(twoway->ice_batchDatagram()); ObjectAdapterPtr adapter = communicator()->createObjectAdapter("CallbackReceiverAdapter"); - CallbackReceiverPrx receiver = CallbackReceiverPrx::uncheckedCast( - adapter->createProxy(stringToIdentity("callbackReceiver"))); adapter->add(new CallbackReceiverI, stringToIdentity("callbackReceiver")); adapter->activate(); + CallbackReceiverPrx twowayR = CallbackReceiverPrx::uncheckedCast( + adapter->createProxy(stringToIdentity("callbackReceiver"))); + CallbackReceiverPrx onewayR = CallbackReceiverPrx::uncheckedCast(twowayR->ice_oneway()); +// CallbackReceiverPrx batchOnewayR = CallbackReceiverPrx::uncheckedCast(twowayR->ice_batchOneway()); + CallbackReceiverPrx datagramR = CallbackReceiverPrx::uncheckedCast(twowayR->ice_datagram()); +// CallbackReceiverPrx batchDatagramR = CallbackReceiverPrx::uncheckedCast(twowayR->ice_batchDatagram()); + bool secure = false; + string secureStr = ""; menu(); @@ -87,23 +93,33 @@ CallbackClient::run(int argc, char* argv[]) cin >> c; if (c == 't') { - twoway->initiateCallback(receiver); + Context context; + context["_fwd"] = "t" + secureStr; + twoway->initiateCallback(twowayR, context); } else if (c == 'o') { - oneway->initiateCallback(receiver); + Context context; + context["_fwd"] = "o" + secureStr; + oneway->initiateCallback(onewayR, context); } else if (c == 'O') { - batchOneway->initiateCallback(receiver); + Context context; + context["_fwd"] = "o" + secureStr; + batchOneway->initiateCallback(onewayR, context); } else if (c == 'd') { - datagram->initiateCallback(receiver); + Context context; + context["_fwd"] = "d" + secureStr; + datagram->initiateCallback(datagramR, context); } else if (c == 'D') { - batchDatagram->initiateCallback(receiver); + Context context; + context["_fwd"] = "d" + secureStr; + batchDatagram->initiateCallback(datagramR, context); } else if (c == 'f') { @@ -113,12 +129,19 @@ CallbackClient::run(int argc, char* argv[]) else if (c == 'S') { secure = !secure; + secureStr = secure ? "s" : ""; twoway = CallbackPrx::uncheckedCast(twoway->ice_secure(secure)); oneway = CallbackPrx::uncheckedCast(oneway->ice_secure(secure)); batchOneway = CallbackPrx::uncheckedCast(batchOneway->ice_secure(secure)); datagram = CallbackPrx::uncheckedCast(datagram->ice_secure(secure)); batchDatagram = CallbackPrx::uncheckedCast(batchDatagram->ice_secure(secure)); + + twowayR = CallbackReceiverPrx::uncheckedCast(twowayR->ice_secure(secure)); + onewayR = CallbackReceiverPrx::uncheckedCast(onewayR->ice_secure(secure)); +// batchOnewayR = CallbackReceiverPrx::uncheckedCast(batchOnewayR->ice_secure(secure)); + datagramR = CallbackReceiverPrx::uncheckedCast(datagramR->ice_secure(secure)); +// batchDatagramR = CallbackReceiverPrx::uncheckedCast(batchDatagramR->ice_secure(secure)); if (secure) { diff --git a/cpp/demo/Ice/callback/config b/cpp/demo/Ice/callback/config index b21a9b61e14..82dfee07b5e 100644 --- a/cpp/demo/Ice/callback/config +++ b/cpp/demo/Ice/callback/config @@ -1,7 +1,7 @@ Callback.Callback=callback:tcp -h 192.168.2.2 -p 10000:udp -h 192.168.2.2 -p 10000:ssl -h 192.168.2.2 -p 10001#:sudp -h 192.168.2.2 -p 10001 Ice.Adapter.CallbackReceiverAdapter.Endpoints=tcp:udp:ssl#:sudp -#Ice.Trace.Network=1 +Ice.Trace.Network=3 #Ice.Trace.Protocol=1 #Ice.ConnectionWarnings=1 diff --git a/cpp/demo/Ice/callback/config.server b/cpp/demo/Ice/callback/config.server index dd79ed1668b..9d0c73b1f08 100644 --- a/cpp/demo/Ice/callback/config.server +++ b/cpp/demo/Ice/callback/config.server @@ -1,6 +1,6 @@ Ice.Adapter.CallbackAdapter.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001 #:sudp -p 10001
-#Ice.Trace.Network=1
+Ice.Trace.Network=3
#Ice.Trace.Protocol=1
#Ice.ConnectionWarnings=1
diff --git a/cpp/slice/Ice/Current.ice b/cpp/slice/Ice/Current.ice index 0cafe51dde8..156ea072d9d 100644 --- a/cpp/slice/Ice/Current.ice +++ b/cpp/slice/Ice/Current.ice @@ -62,14 +62,6 @@ local struct Current /** * - * Set to false if the operation call was sent oneway or with a - * datagram protocol. - * - **/ - bool response; - - /** - * * Set to true if the operation is nonmutating. * **/ diff --git a/cpp/src/Glacier/ClientBlobject.cpp b/cpp/src/Glacier/ClientBlobject.cpp index 5d956bb984a..9cd92e4a459 100644 --- a/cpp/src/Glacier/ClientBlobject.cpp +++ b/cpp/src/Glacier/ClientBlobject.cpp @@ -59,10 +59,48 @@ Glacier::ClientBlobject::ice_invoke(const std::vector<Byte>& inParams, std::vect { proxy = proxy->ice_newFacet(current.facet); } - - if (!current.response) + + Context::const_iterator p = current.context.find("_fwd"); + if (p != current.context.end()) { - proxy = proxy->ice_oneway(); + for (unsigned int i = 0; i < p->second.length(); ++i) + { + char option = p->second[i]; + switch (option) + { + case 't': + { + proxy = proxy->ice_twoway(); + break; + } + + case 'o': + { + proxy = proxy->ice_oneway(); + break; + } + + case 'd': + { + proxy = proxy->ice_datagram(); + break; + } + + case 's': + { + proxy = proxy->ice_secure(true); + break; + } + + default: + { + ostringstream s; + s << "unknown forward option `" << option << "'"; + _logger->warning(s.str()); + break; + } + } + } } if (_traceLevel >= 2) diff --git a/cpp/src/Glacier/ServerBlobject.cpp b/cpp/src/Glacier/ServerBlobject.cpp index cf9055387a2..16d3ae71c01 100644 --- a/cpp/src/Glacier/ServerBlobject.cpp +++ b/cpp/src/Glacier/ServerBlobject.cpp @@ -53,9 +53,47 @@ Glacier::ServerBlobject::ice_invoke(const std::vector<Byte>& inParams, std::vect proxy = proxy->ice_newFacet(current.facet); } - if (!current.response) + Context::const_iterator p = current.context.find("_fwd"); + if (p != current.context.end()) { - proxy = proxy->ice_oneway(); + for (unsigned int i = 0; i < p->second.length(); ++i) + { + char option = p->second[i]; + switch (option) + { + case 't': + { + proxy = proxy->ice_twoway(); + break; + } + + case 'o': + { + proxy = proxy->ice_oneway(); + break; + } + + case 'd': + { + proxy = proxy->ice_datagram(); + break; + } + + case 's': + { + proxy = proxy->ice_secure(true); + break; + } + + default: + { + ostringstream s; + s << "unknown forward option `" << option << "'"; + _logger->warning(s.str()); + break; + } + } + } } if (_traceLevel >= 2) diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 4a614ed2203..17863d0fcd5 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -29,7 +29,6 @@ void IceInternal::Incoming::invoke(bool response) { Current current; - current.response = response; current.identity.__read(&_is); _is.read(current.facet); _is.read(current.operation); |