本文整理汇总了C++中ice::ObjectPrxPtr::ice_datagram方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrxPtr::ice_datagram方法的具体用法?C++ ObjectPrxPtr::ice_datagram怎么用?C++ ObjectPrxPtr::ice_datagram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectPrxPtr
的用法示例。
在下文中一共展示了ObjectPrxPtr::ice_datagram方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: is
//.........这里部分代码省略.........
ipEndpoint = getTCPEndpointInfo(publishedEndpoints[0]->getInfo());
test(ipEndpoint->host == helper->getTestHost());
test(ipEndpoint->port == port);
adapter->destroy();
}
cout << "ok" << endl;
}
string endpoints = helper->getTestEndpoint() + ":" + helper->getTestEndpoint("udp") + " -c";
int port = helper->getTestPort();
Ice::ObjectPrxPtr base = communicator->stringToProxy("test:" + endpoints);
TestIntfPrxPtr testIntf = ICE_CHECKED_CAST(TestIntfPrx, base);
cout << "test connection endpoint information... " << flush;
{
Ice::EndpointInfoPtr info = base->ice_getConnection()->getEndpoint()->getInfo();
Ice::TCPEndpointInfoPtr tcpinfo = getTCPEndpointInfo(info);
test(tcpinfo->port == port);
test(!tcpinfo->compress);
test(tcpinfo->host == defaultHost);
ostringstream os;
Ice::Context ctx = testIntf->getEndpointInfoAsContext();
test(ctx["host"] == tcpinfo->host);
test(ctx["compress"] == "false");
istringstream is(ctx["port"]);
int portCtx;
is >> portCtx;
test(portCtx > 0);
info = base->ice_datagram()->ice_getConnection()->getEndpoint()->getInfo();
Ice::UDPEndpointInfoPtr udp = ICE_DYNAMIC_CAST(Ice::UDPEndpointInfo, info);
test(udp);
test(udp->port == portCtx);
test(udp->host == defaultHost);
}
cout << "ok" << endl;
cout << "testing connection information... " << flush;
{
Ice::ConnectionPtr connection = base->ice_getConnection();
connection->setBufferSize(1024, 2048);
Ice::TCPConnectionInfoPtr info = getTCPConnectionInfo(connection->getInfo());
test(info);
test(!info->incoming);
test(info->adapterName.empty());
test(info->localPort > 0);
test(info->remotePort == port);
if(defaultHost == "127.0.0.1")
{
test(info->remoteAddress == defaultHost);
test(info->localAddress == defaultHost);
}
#if !defined(ICE_OS_UWP)
test(info->rcvSize >= 1024);
test(info->sndSize >= 2048);
#endif
ostringstream os;
Ice::Context ctx = testIntf->getConnectionInfoAsContext();
test(ctx["incoming"] == "true");