diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-10-27 12:00:32 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-10-27 12:00:32 +0100 |
commit | 1fdb973182e589b0d20e987360bd694ae783b0a2 (patch) | |
tree | a94cbbcc0d078bcf7aa4427951799e09feb80826 /cpp/test/Ice/udp/TestI.cpp | |
parent | add support for number protocol in Python (diff) | |
download | ice-1fdb973182e589b0d20e987360bd694ae783b0a2.tar.bz2 ice-1fdb973182e589b0d20e987360bd694ae783b0a2.tar.xz ice-1fdb973182e589b0d20e987360bd694ae783b0a2.zip |
Cleaned up UDP transceivers, fixes for bug 4223 and 4320
Diffstat (limited to 'cpp/test/Ice/udp/TestI.cpp')
-rw-r--r-- | cpp/test/Ice/udp/TestI.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cpp/test/Ice/udp/TestI.cpp b/cpp/test/Ice/udp/TestI.cpp index 55657e25ada..7eaaa927ffa 100644 --- a/cpp/test/Ice/udp/TestI.cpp +++ b/cpp/test/Ice/udp/TestI.cpp @@ -41,6 +41,38 @@ TestIntfI::sendByteSeq(const Test::ByteSeq&, const Test::PingReplyPrx& reply, co } void +TestIntfI::pingBiDir(const Ice::Identity& id, const Ice::Current& current) +{ + try + { + // + // Ensure sending too much data doesn't cause the UDP connection + // to be closed. + // + try + { + Test::ByteSeq seq; + seq.resize(32 * 1024); + Test::TestIntfPrx::uncheckedCast(current.con->createProxy(id))->sendByteSeq(seq, 0); + } + catch(const DatagramLimitException&) + { + // Expected. + } + + // + // Send the reply through the incoming connection. + // + Test::PingReplyPrx::uncheckedCast(current.con->createProxy(id))->reply(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + assert(false); + } +} + +void TestIntfI::shutdown(const Current& current) { current.adapter->getCommunicator()->shutdown(); |