本文整理汇总了C++中Endpoint::SetPort方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::SetPort方法的具体用法?C++ Endpoint::SetPort怎么用?C++ Endpoint::SetPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Endpoint
的用法示例。
在下文中一共展示了Endpoint::SetPort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NetworkAccept
THandle Os::NetworkAccept(THandle aHandle, Endpoint& aClient)
{
TIpAddress clientAddress;
TUint32 clientPort;
THandle handle = OsNetworkAccept(aHandle, &clientAddress, &clientPort);
aClient.SetAddress(clientAddress);
aClient.SetPort(clientPort);
return handle;
}
示例2: OsNetworkReceiveFrom
TInt OpenHome::Os::NetworkReceiveFrom(THandle aHandle, Bwx& aBuffer, Endpoint& aEndpoint)
{
TIpAddress address;
TUint16 port;
TInt ret = OsNetworkReceiveFrom(aHandle, (uint8_t*)aBuffer.Ptr(), aBuffer.MaxBytes(), &address, &port);
if (ret != -1) {
aEndpoint.SetAddress(address);
aEndpoint.SetPort(port);
}
return ret;
}
示例3: Start
void CatchupReader::Start(unsigned nodeID)
{
Log_Trace();
bool ret;
Endpoint endpoint;
ret = true;
count = 0;
ret &= transaction.Begin();
if (!ret)
ASSERT_FAIL();
endpoint = RCONF->GetEndpoint(nodeID);
endpoint.SetPort(endpoint.GetPort() + CATCHUP_PORT_OFFSET);
Connect(endpoint, CATCHUP_CONNECT_TIMEOUT);
}