diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-02-12 15:05:06 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-02-12 15:05:06 +0000 |
commit | ddfe7ed4bf1fc5753e81fdf814eee431b25d0f42 (patch) | |
tree | 48ad786e15c3bef71a571397c1a4afd8af748783 /cpp/test | |
parent | Update properties (diff) | |
download | ice-ddfe7ed4bf1fc5753e81fdf814eee431b25d0f42.tar.bz2 ice-ddfe7ed4bf1fc5753e81fdf814eee431b25d0f42.tar.xz ice-ddfe7ed4bf1fc5753e81fdf814eee431b25d0f42.zip |
Fixed bug 1784
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/IceStorm/single/Subscriber.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/cpp/test/IceStorm/single/Subscriber.cpp b/cpp/test/IceStorm/single/Subscriber.cpp index 88d28a4e21e..e8578d173d5 100644 --- a/cpp/test/IceStorm/single/Subscriber.cpp +++ b/cpp/test/IceStorm/single/Subscriber.cpp @@ -173,16 +173,26 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) topic->subscribe(qos, adapter->addWithUUID(subscribers.back())); } { + // Use a separate adapter to ensure a separate connection is used for the subscriber + // (otherwise, if multiple UDP subscribers use the same connection we might get high + // packet loss, see bug 1784). + ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdater1", "udp"); subscribers.push_back(new SingleI(communicator, "datagram")); IceStorm::QoS qos; qos["reliability"] = "oneway"; - topic->subscribe(IceStorm::QoS(), adapter->addWithUUID(subscribers.back())->ice_datagram()); + topic->subscribe(IceStorm::QoS(), adpt->addWithUUID(subscribers.back())->ice_datagram()); + adpt->activate(); } { + // Use a separate adapter to ensure a separate connection is used for the subscriber + // (otherwise, if multiple UDP subscribers use the same connection we might get high + // packet loss, see bug 1784). + ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdater2", "udp"); subscribers.push_back(new SingleI(communicator, "batch datagram")); IceStorm::QoS qos; qos["reliability"] = "batch"; - topic->subscribe(IceStorm::QoS(), adapter->addWithUUID(subscribers.back())->ice_datagram()); + topic->subscribe(IceStorm::QoS(), adpt->addWithUUID(subscribers.back())->ice_datagram()); + adpt->activate(); } // // Next we use the new API call with the new proxy semantics. @@ -210,12 +220,22 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) topic->subscribeAndGetPublisher(qos, adapter->addWithUUID(subscribers.back())); } { + // Use a separate adapter to ensure a separate connection is used for the subscriber + // (otherwise, if multiple UDP subscribers use the same connection we might get high + // packet loss, see bug 1784). + ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdater3", "udp"); subscribers.push_back(new SingleI(communicator, "datagram")); - topic->subscribeAndGetPublisher(IceStorm::QoS(), adapter->addWithUUID(subscribers.back())->ice_datagram()); + topic->subscribeAndGetPublisher(IceStorm::QoS(), adpt->addWithUUID(subscribers.back())->ice_datagram()); + adpt->activate(); } { + // Use a separate adapter to ensure a separate connection is used for the subscriber + // (otherwise, if multiple UDP subscribers use the same connection we might get high + // packet loss, see bug 1784). + ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdater4", "udp"); subscribers.push_back(new SingleI(communicator, "batch datagram")); - topic->subscribeAndGetPublisher(IceStorm::QoS(), adapter->addWithUUID(subscribers.back())->ice_batchDatagram()); + topic->subscribeAndGetPublisher(IceStorm::QoS(), adpt->addWithUUID(subscribers.back())->ice_batchDatagram()); + adpt->activate(); } adapter->activate(); |