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


C++ NetAddress::data方法代码示例

本文整理汇总了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;
}
开发者ID:Azzuro,项目名称:MediaPortal-1,代码行数:20,代码来源:SIPClient.cpp

示例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;
}
开发者ID:glo,项目名称:ee384b,代码行数:37,代码来源:playSIP.cpp

示例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));
}
开发者ID:boodjoom,项目名称:live555,代码行数:36,代码来源:playSIP.cpp

示例4: assign

NetAddress::NetAddress(NetAddress const& orig) {
  assign(orig.data(), orig.length());
}
开发者ID:ShawnOfMisfit,项目名称:ambarella,代码行数:3,代码来源:NetAddress.cpp


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