summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/udp/TestI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-10-27 12:00:32 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-10-27 12:00:32 +0100
commit1fdb973182e589b0d20e987360bd694ae783b0a2 (patch)
treea94cbbcc0d078bcf7aa4427951799e09feb80826 /cpp/test/Ice/udp/TestI.cpp
parentadd support for number protocol in Python (diff)
downloadice-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.cpp32
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();