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


C++ DNSClient::begin方法代码示例

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


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

示例1: dnsLookup

//convert a hostname to an ip address
int GroveStreams::dnsLookup(const char* hostname, IPAddress& addr)
{
    int ret = 0;
    DNSClient dns;

    dns.begin(Ethernet.dnsServerIP());
    ret = dns.getHostByName(hostname, addr);
    return ret;
}
开发者ID:JChristensen,项目名称:GroveStreams,代码行数:10,代码来源:GroveStreams.cpp

示例2: connect

int EthernetClient::connect(const char* host, uint16_t port) {
  // Look up the host first
  int ret = 0;
  DNSClient dns;
  IPAddress remote_addr;

  dns.begin(Ethernet.dnsServerIP());
  ret = dns.getHostByName(host, remote_addr);
  if (ret == 1) {
    return connect(remote_addr, port);
  } else {
    return ret;
  }
}
开发者ID:arcadien,项目名称:ArduinoSkeleton,代码行数:14,代码来源:EthernetClient.cpp

示例3: connect

int EthernetClient::connect(const char* host, uint16_t port)
{
	int ret = 0;
	DNSClient dns;
	IPAddress remote_addr;
	IPAddress dns_server;

	dns.begin(Ethernet.dnsServerIP());
	ret = dns.getHostByName(host, remote_addr);
	if (ret == 1)
		return connect(remote_addr, port);
	
	return ret;
}
开发者ID:aquashift,项目名称:86Duino_DuinOS,代码行数:14,代码来源:EthernetClient.cpp

示例4: iClient

HttpClient::HttpClient(Client& aClient, const char* aProxy, uint16_t aProxyPort)
 : iClient(&aClient), iProxyPort(aProxyPort)
{
  resetState();
  if (aProxy)
  {
    // Resolve the IP address for the proxy
    DNSClient dns;
    dns.begin(Ethernet.dnsServerIP());
    // Not ideal that we discard any errors here, but not a lot we can do in the ctor
    // and we'll get a connect error later anyway
    (void)dns.getHostByName(aProxy, iProxyAddress);
  }
}
开发者ID:AnakinSpain,项目名称:Libreria,代码行数:14,代码来源:HttpClient.cpp

示例5: beginPacket

int EthernetUDP::beginPacket(const char *host, uint16_t port)
{
	// Look up the host first
	int ret = 0;
	DNSClient dns;
	IPAddress remote_addr;

	dns.begin(Ethernet.dnsServerIP());
	ret = dns.getHostByName(host, remote_addr);
	if (ret == 1)
		return beginPacket(remote_addr, port);
	else
		return ret;
}
开发者ID:aquashift,项目名称:86Duino_DuinOS,代码行数:14,代码来源:EthernetUdp.cpp

示例6: connect

int EthernetClient::connect(const char * host, uint16_t port)
{
	DNSClient dns; // Look up the host first
	IPAddress remote_addr;

	if (sockindex < MAX_SOCK_NUM) {
		if (Ethernet.socketStatus(sockindex) != SnSR::CLOSED) {
			Ethernet.socketDisconnect(sockindex); // TODO: should we call stop()?
		}
		sockindex = MAX_SOCK_NUM;
	}
	dns.begin(Ethernet.dnsServerIP());
	if (!dns.getHostByName(host, remote_addr)) return 0; // TODO: use _timeout
	return connect(remote_addr, port);
}
开发者ID:FernandoGarcia,项目名称:Ferduino_with_webcontrol_beta,代码行数:15,代码来源:EthernetClient.cpp

示例7: connect

/**
 * @brief
 * @note
 * @param
 * @retval
 */
int UIPClient::connect(const char* host, uint16_t port) {

    // Look up the host first
    int         ret = 0;
#if UIP_UDP
    DNSClient   dns;
    IPAddress   remote_addr;

    dns.begin(UIPEthernetClass::_dnsServerAddress);
    ret = dns.getHostByName(host, remote_addr);
    if(ret == 1) {
        return connect(remote_addr, port);
    }
#endif
    return ret;
}
开发者ID:ubergeekNZ,项目名称:tracker,代码行数:22,代码来源:UIPClient.cpp


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