本文整理汇总了C++中BReference::InitCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ BReference::InitCheck方法的具体用法?C++ BReference::InitCheck怎么用?C++ BReference::InitCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BReference
的用法示例。
在下文中一共展示了BReference::InitCheck方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ParseLinkAddress
status_t
BNetworkAddress::SetTo(int family, const char* host, const char* service,
uint32 flags)
{
if (family == AF_LINK) {
if (service != NULL)
return B_BAD_VALUE;
return _ParseLinkAddress(host);
// SetToLinkAddress takes care of setting fStatus
}
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(family, host, service, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
uint32 cookie = 0;
status = resolver->GetNextAddress(&cookie, *this);
if (status != B_OK)
Unset();
fHostName = host;
fStatus = status;
return status;
}
示例2:
status_t
BNetworkAddress::SetTo(const char* host, const char* service, uint32 flags)
{
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(host, service, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
// Prefer IPv6 addresses
uint32 cookie = 0;
status = resolver->GetNextAddress(AF_INET6, &cookie, *this);
if (status != B_OK) {
cookie = 0;
status = resolver->GetNextAddress(&cookie, *this);
if (status != B_OK)
Unset();
}
fHostName = host;
fStatus = status;
return status;
}
示例3: _ParseLinkAddress
status_t
BNetworkAddress::SetTo(int family, const char* host, uint16 port, uint32 flags)
{
if (family == AF_LINK) {
if (port != 0)
return B_BAD_VALUE;
return _ParseLinkAddress(host);
}
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(family, host, port, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
uint32 cookie = 0;
return resolver->GetNextAddress(&cookie, *this);
}
示例4:
status_t
BNetworkAddress::SetTo(const char* host, uint16 port, uint32 flags)
{
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(host, port, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
// Prefer IPv6 addresses
uint32 cookie = 0;
status = resolver->GetNextAddress(AF_INET6, &cookie, *this);
if (status == B_OK)
return B_OK;
cookie = 0;
return resolver->GetNextAddress(&cookie, *this);
}