本文整理汇总了C++中ice::ConnectionPtr::setBufferSize方法的典型用法代码示例。如果您正苦于以下问题:C++ ConnectionPtr::setBufferSize方法的具体用法?C++ ConnectionPtr::setBufferSize怎么用?C++ ConnectionPtr::setBufferSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ConnectionPtr
的用法示例。
在下文中一共展示了ConnectionPtr::setBufferSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: is
//.........这里部分代码省略.........
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");
test(ctx["adapterName"] == "TestAdapter");
test(ctx["remoteAddress"] == info->localAddress);
test(ctx["localAddress"] == info->remoteAddress);
os.str("");
os << info->localPort;
test(ctx["remotePort"] == os.str());
os.str("");
os << info->remotePort;
test(ctx["localPort"] == os.str());
if(base->ice_getConnection()->type() == "ws" || base->ice_getConnection()->type() == "wss")