当前位置: 首页>>代码示例>>C++>>正文


C++ Endpoint::Address方法代码示例

本文整理汇总了C++中Endpoint::Address方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::Address方法的具体用法?C++ Endpoint::Address怎么用?C++ Endpoint::Address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Endpoint的用法示例。


在下文中一共展示了Endpoint::Address方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsLocationReachable

TBool DviProtocolUpnpAdapterSpecificData::IsLocationReachable(const Endpoint& aEndpoint)
{
    /* This method has the same purpose as CpiDeviceListUpnp::IsLocationReachable.
        The reachability check is needed to ensure that all M-SEARCH responses contain
        a location Uri that can be accessed by the M-SEARCH sender. */
    return (aEndpoint.Address() & iMask) == (iSubnet & iMask);
}
开发者ID:Montellese,项目名称:ohNet,代码行数:7,代码来源:DviProtocolUpnp.cpp

示例2: OsNetworkConnect

void OpenHome::Os::NetworkConnect(THandle aHandle, const Endpoint& aEndpoint, TUint aTimeoutMs)
{
    int32_t err = OsNetworkConnect(aHandle, aEndpoint.Address(), aEndpoint.Port(), aTimeoutMs);
    if (err != 0) {
        LOG2F(kNetwork, kError, "Os::NetworkConnect H = %d, RETURN VALUE = %d\n", aHandle, err);
        THROW(NetworkError);
    }
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:8,代码来源:OsWrapper.cpp

示例3: OsNetworkConnect

void OpenHome::Os::NetworkConnect(THandle aHandle, const Endpoint& aEndpoint, TUint aTimeoutMs)
{
    int32_t err = OsNetworkConnect(aHandle, aEndpoint.Address(), aEndpoint.Port(), aTimeoutMs);
    if (err != 0) {
        LOG2F(kNetwork, kError, "Os::NetworkConnect H = %d, RETURN VALUE = %d\n", aHandle, err);
        if (err == -1)  // Timeout
            THROW(NetworkTimeout);
        if (err == -2)  // Connection refused
            THROW(NetworkError);
        ASSERTS(); // invalid error
    }
}
开发者ID:Montellese,项目名称:ohNet,代码行数:12,代码来源:OsWrapper.cpp

示例4: Listen

void MdnsPlatform::Listen()
{
    LOG(kBonjour, "Bonjour             Listen\n");

    mDNSAddr dst;
    mDNSIPPort dstport;
    SetAddress(dst, iMulticast);
    SetPort(dstport, iMulticast);

    mDNSAddr src;
    mDNSIPPort srcport;
    while (!iStop) {
        try {
            LOG(kBonjour, "Bonjour             Listen - Wait For Message\n");
            iReaderController.Read(iMessage);
            LOG(kBonjour, "Bonjour             Listen - Message Received\n");

            TByte* ptr = (TByte*)iMessage.Ptr();
            TUint bytes = iMessage.Bytes();
            Endpoint sender = iReaderController.Sender();
            SetAddress(src, sender);
            SetPort(srcport, sender);
            iInterfacesLock.Wait();
            TIpAddress senderAddr = sender.Address();
            mDNSInterfaceID interfaceId = (mDNSInterfaceID)0;
            for (TUint i=0; i<(TUint)iInterfaces.size(); i++) {
                if (iInterfaces[i]->ContainsAddress(senderAddr)) {
#ifndef DEFINE_WINDOWS_UNIVERSAL
                    interfaceId = (mDNSInterfaceID)iInterfaces[i]->Address();
#endif // DEFINE_WINDOWS_UNIVERSAL
                    break;
                }
            }
            iInterfacesLock.Signal();
            if (interfaceId != (mDNSInterfaceID)0) {
                mDNSCoreReceive(iMdns, ptr, ptr + bytes, &src, srcport, &dst, dstport, interfaceId);
            }
            iReaderController.ReadFlush();
        }
        catch (ReaderError) {
            if (!iStop) {
                LOG(kBonjour, "Bonjour             Listen - Reader Error\n");
            }
        }
    }
}
开发者ID:openhome,项目名称:ohNet,代码行数:46,代码来源:MdnsPlatform.cpp

示例5: SetEndpoint

void OhmSenderDriverWindows::SetEndpoint(const Endpoint& aEndpoint)
{
	KSPROPERTY prop;
				
	prop.Set = SNEAKY_GUID;
    prop.Id = KSPROPERTY_SNEAKY_ENDPOINT;
    prop.Flags = KSPROPERTY_TYPE_SET;

	TByte buffer[8];

	ULONG* ptr = (ULONG*)buffer;
	
	*ptr++ = Arch::BigEndian4(aEndpoint.Address());
	*ptr++ = aEndpoint.Port();

    DWORD bytes;

    DeviceIoControl(iHandle, IOCTL_KS_PROPERTY, &prop, sizeof(KSPROPERTY), &buffer, sizeof(buffer), &bytes, 0);
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:19,代码来源:Soundcard.cpp

示例6: NetworkBind

TInt Os::NetworkBind(THandle aHandle, const Endpoint& aEndpoint)
{
	TInt ret = OsNetworkBind(aHandle, aEndpoint.Address(), aEndpoint.Port());
	return ret;
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:5,代码来源:OsWrapper.cpp

示例7: NetworkBindMulticast

TInt Os::NetworkBindMulticast(THandle aHandle, TIpAddress aAdapter, const Endpoint& aMulticast)
{
    TInt ret = OsNetworkBindMulticast(aHandle, aAdapter, aMulticast.Address(), aMulticast.Port());
    return ret;
}
开发者ID:tata-,项目名称:ohNet-1,代码行数:5,代码来源:OsWrapper.cpp

示例8: GetClientEndpoint

void DvInvocationStd::GetClientEndpoint(TIpAddress& aClientAddress, uint32_t& aClientPort) const
{
    Endpoint ep = iInvocation.ClientEndpoint();
    aClientAddress = ep.Address();
    aClientPort = ep.Port();
}
开发者ID:ACDN,项目名称:ohNet,代码行数:6,代码来源:DvInvocationStd.cpp


注:本文中的Endpoint::Address方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。