本文整理汇总了C++中TInetAddr::ConvertToV4方法的典型用法代码示例。如果您正苦于以下问题:C++ TInetAddr::ConvertToV4方法的具体用法?C++ TInetAddr::ConvertToV4怎么用?C++ TInetAddr::ConvertToV4使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TInetAddr
的用法示例。
在下文中一共展示了TInetAddr::ConvertToV4方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConnectionAcceptedL
// -----------------------------------------------------------------------------
// CUpnpHttpServer::ConnectionAcceptedL
//
// -----------------------------------------------------------------------------
//
CUpnpTcpSession* CUpnpHttpServer::ConnectionAcceptedL( RSocket aSocket )
{
LOG_FUNC_NAME;
#ifdef _DEBUG
TInetAddr tempAddr;
aSocket.RemoteName( tempAddr );
tempAddr.ConvertToV4();
const TInt KMaxAdressLength = 20;
TBuf<KMaxAdressLength> addrBuf;
tempAddr.Output( addrBuf );
HBufC8* addrBuf8 = UpnpString::FromUnicodeL( addrBuf );
CleanupStack::PushL( addrBuf8 );
LOGS( "CUpnpHttpServer::ConnectionAcceptedL - Remote socket connected" );
LOGT( addrBuf8->Des() );
LOGS1("CUpnpHttpServer::ConnectionAcceptedL - Creating a new Http session. Session count: %i", iSessionList.Count());
CleanupStack::PopAndDestroy(addrBuf8);
#endif //_DEBUG
CUpnpHttpSession* sess = CUpnpHttpSession::NewL( aSocket, this,
CUpnpHttpMessage::NewSessionIdL(), EPriorityNormal );
return sess;
}
示例2:
enum TVerdict CEsockTest19_6::easyTestStepL()
{
TInetAddr addr;
TBuf<39> buf;
// convert to V4
// set address to IPv6 unspecified address
addr.Input(_L("::"));
// convert to IPv4 format
addr.ConvertToV4();
addr.OutputWithScope(buf);
// check address has been reformatted correctly
addr.OutputWithScope(buf);
TESTL(buf==_L("0.0.0.0"));
// change address to IPv4 compatible address
addr.Input(_L("::199.12.255.21"));
// convert to IPv4 format
addr.ConvertToV4();
// check address has been reformatted correctly
addr.OutputWithScope(buf);
TESTL(buf==_L("199.12.255.21"));
// change address to IPv4 mapped address
addr.Input(_L("::FFFF:149.124.223.12"));
// convert to IPv4 format
addr.ConvertToV4();
// check address has been reformatted correctly
addr.OutputWithScope(buf);
TESTL(buf==_L("149.124.223.12"));
return EPass;
}
示例3: CheckAndSetAddr
// -----------------------------------------------------------------------------
// CLocalAddrResolver::CheckAndSetAddr
// -----------------------------------------------------------------------------
//
void CLocalAddrResolver::CheckAndSetAddr( TInetAddr& aTarget,
TInetAddr& aCandidate,
TUint32 aCandidateIap,
TUint32 aSpecifiedIap )
{
if ( !aCandidate.IsUnspecified() && !aCandidate.IsLoopback() )
{
if ( aCandidate.IsV4Mapped())
{
aCandidate.ConvertToV4();
}
if ( aCandidateIap == aSpecifiedIap )
{
SetAddr( aTarget, aCandidate );
}
}
}