本文整理汇总了C++中NetAddress::data方法的典型用法代码示例。如果您正苦于以下问题:C++ NetAddress::data方法的具体用法?C++ NetAddress::data怎么用?C++ NetAddress::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetAddress
的用法示例。
在下文中一共展示了NetAddress::data方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processURL
Boolean SIPClient::processURL(char const* url) {
do {
// If we don't already have a server address/port, then
// get these by parsing the URL:
if (fServerAddress.s_addr == 0) {
NetAddress destAddress;
if (!parseSIPURL(envir(), url, destAddress, fServerPortNum)) break;
fServerAddress.s_addr = *(unsigned*)(destAddress.data());
if (fOurSocket != NULL) {
fOurSocket->changeDestinationParameters(fServerAddress,
fServerPortNum, 255);
}
}
return True;
} while (0);
return False;
}
示例2: getSDPDescriptionFromURL
char* getSDPDescriptionFromURL(Medium* client, char const* url,
char const* username, char const* password,
char const* proxyServerName,
unsigned short proxyServerPortNum,
unsigned short clientStartPortNum) {
SIPClient* sipClient = (SIPClient*)client;
if (proxyServerName != NULL) {
// Tell the SIP client about the proxy:
NetAddressList addresses(proxyServerName);
if (addresses.numAddresses() == 0) {
client->envir() << "Failed to find network address for \""
<< proxyServerName << "\"\n";
} else {
NetAddress address = *(addresses.firstAddress());
unsigned proxyServerAddress // later, allow for IPv6 #####
= *(unsigned*)(address.data());
if (proxyServerPortNum == 0) proxyServerPortNum = 5060; // default
sipClient->setProxyServer(proxyServerAddress, proxyServerPortNum);
}
}
if (clientStartPortNum == 0) clientStartPortNum = 8000; // default
sipClient->setClientStartPortNum(clientStartPortNum);
char* result;
if (username != NULL && password != NULL) {
result = sipClient->inviteWithPassword(url, username, password);
} else {
result = sipClient->invite(url);
}
extern unsigned statusCode;
statusCode = sipClient->inviteStatus();
return result;
}
示例3: getSDPDescription
void getSDPDescription(RTSPClient::responseHandler* afterFunc) {
extern char* proxyServerName;
if (proxyServerName != NULL) {
// Tell the SIP client about the proxy:
NetAddressList addresses(proxyServerName);
if (addresses.numAddresses() == 0) {
ourSIPClient->envir() << "Failed to find network address for \"" << proxyServerName << "\"\n";
} else {
NetAddress address = *(addresses.firstAddress());
unsigned proxyServerAddress // later, allow for IPv6 #####
= *(unsigned*)(address.data());
extern unsigned short proxyServerPortNum;
if (proxyServerPortNum == 0) proxyServerPortNum = 5060; // default
ourSIPClient->setProxyServer(proxyServerAddress, proxyServerPortNum);
}
}
extern unsigned short desiredPortNum;
unsigned short clientStartPortNum = desiredPortNum;
if (clientStartPortNum == 0) clientStartPortNum = 8000; // default
ourSIPClient->setClientStartPortNum(clientStartPortNum);
extern char const* streamURL;
char const* username = ourAuthenticator == NULL ? NULL : ourAuthenticator->username();
char const* password = ourAuthenticator == NULL ? NULL : ourAuthenticator->password();
char* result;
if (username != NULL && password != NULL) {
result = ourSIPClient->inviteWithPassword(streamURL, username, password);
} else {
result = ourSIPClient->invite(streamURL);
}
int resultCode = result == NULL ? -1 : 0;
afterFunc(NULL, resultCode, strDup(result));
}
示例4: assign
NetAddress::NetAddress(NetAddress const& orig) {
assign(orig.data(), orig.length());
}