本文整理汇总了C++中TestIntfPrx::sendByteSeq方法的典型用法代码示例。如果您正苦于以下问题:C++ TestIntfPrx::sendByteSeq方法的具体用法?C++ TestIntfPrx::sendByteSeq怎么用?C++ TestIntfPrx::sendByteSeq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestIntfPrx
的用法示例。
在下文中一共展示了TestIntfPrx::sendByteSeq方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void
allTests(const CommunicatorPtr& communicator)
{
communicator->getProperties()->setProperty("ReplyAdapter.Endpoints", "udp -p 12030");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ReplyAdapter");
PingReplyIPtr replyI = new PingReplyI;
PingReplyPrx reply = PingReplyPrx::uncheckedCast(adapter->addWithUUID(replyI))->ice_datagram();
adapter->activate();
cout << "testing udp... " << flush;
ObjectPrx base = communicator->stringToProxy("test -d:udp -p 12010");
TestIntfPrx obj = TestIntfPrx::uncheckedCast(base);
int nRetry = 5;
bool ret;
while(nRetry-- > 0)
{
replyI->reset();
obj->ping(reply);
obj->ping(reply);
obj->ping(reply);
ret = replyI->waitReply(3, IceUtil::Time::seconds(2));
if(ret)
{
break; // Success
}
// If the 3 datagrams were not received within the 2 seconds, we try again to
// receive 3 new datagrams using a new object. We give up after 5 retries.
replyI = new PingReplyI;
reply = PingReplyPrx::uncheckedCast(adapter->addWithUUID(replyI))->ice_datagram();
}
test(ret);
if(communicator->getProperties()->getPropertyAsInt("Ice.Override.Compress") == 0)
{
//
// Only run this test if compression is disabled, the test expect fixed message size
// to be sent over the wire.
//
Test::ByteSeq seq;
try
{
seq.resize(1024);
while(true)
{
seq.resize(seq.size() * 2 + 10);
replyI->reset();
obj->sendByteSeq(seq, reply);
replyI->waitReply(1, IceUtil::Time::seconds(10));
}
}
catch(const DatagramLimitException&)
{
test(seq.size() > 16384);
}
obj->ice_getConnection()->close(false);
communicator->getProperties()->setProperty("Ice.UDP.SndSize", "64000");
seq.resize(50000);
try
{
replyI->reset();
obj->sendByteSeq(seq, reply);
test(!replyI->waitReply(1, IceUtil::Time::milliSeconds(500)));
}
catch(const Ice::LocalException& ex)
{
cerr << ex << endl;
test(false);
}
}
cout << "ok" << endl;
string endpoint;
if(communicator->getProperties()->getProperty("Ice.IPv6") == "1")
{
#ifdef __APPLE__
endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
#else
endpoint = "udp -h \"ff15::1:1\" -p 12020";
#endif
}
else
{
endpoint = "udp -h 239.255.1.1 -p 12020";
}
base = communicator->stringToProxy("test -d:" + endpoint);
TestIntfPrx objMcast = TestIntfPrx::uncheckedCast(base);
#if !defined(ICE_OS_WINRT) && (!defined(__APPLE__) || (defined(__APPLE__) && !TARGET_OS_IPHONE))
cout << "testing udp multicast... " << flush;
nRetry = 5;
while(nRetry-- > 0)
{
replyI->reset();
objMcast->ping(reply);
ret = replyI->waitReply(5, IceUtil::Time::seconds(2));
if(ret)
//.........这里部分代码省略.........