diff options
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(); |