本文整理汇总了C++中Endpoint::SetAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::SetAddress方法的具体用法?C++ Endpoint::SetAddress怎么用?C++ Endpoint::SetAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Endpoint
的用法示例。
在下文中一共展示了Endpoint::SetAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Test
void SuiteEndpoint::Test()
{
// Test bad DNS look ups
Endpoint ep;
TEST_THROWS(ep.SetAddress(Brn("baddomainname.linn.co.uk")), NetworkError);
TEST_THROWS(Endpoint ep2(1234, Brn("baddomainname.linn.co.uk")); (void)ep2, NetworkError);
}
示例2: 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;
}
示例3: 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;
}