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


C++ endpoint::protocol方法代码示例

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


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

示例1:

 /**
  * This constructor is typically used to perform name resolution for local
  * service binding.
  *
  * @param service_name A string identifying the requested service. This may
  * be a descriptive name or a numeric string corresponding to a port number.
  *
  * @param resolve_flags A set of flags that determine how name resolution
  * should be performed. The default flags are suitable for local service
  * binding.
  *
  * @note On POSIX systems, service names are typically defined in the file
  * <tt>/etc/services</tt>. On Windows, service names may be found in the file
  * <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
  * may use additional locations when resolving service names.
  */
 basic_resolver_query(const std::string& service_name,
     resolver_query_base::flags resolve_flags = passive | address_configured)
   : hints_(),
     host_name_(),
     service_name_(service_name)
 {
   typename InternetProtocol::endpoint endpoint;
   hints_.ai_flags = static_cast<int>(resolve_flags);
   hints_.ai_family = PF_UNSPEC;
   hints_.ai_socktype = endpoint.protocol().type();
   hints_.ai_protocol = endpoint.protocol().protocol();
   hints_.ai_addrlen = 0;
   hints_.ai_canonname = 0;
   hints_.ai_addr = 0;
   hints_.ai_next = 0;
 }
开发者ID:barrbrain,项目名称:asio,代码行数:32,代码来源:basic_resolver_query.hpp

示例2:

 /// Construct with specified host name and service name for any protocol.
 basic_resolver_query(const std::string& host_name,
     const std::string& service_name, int flags = address_configured)
   : hints_(),
     host_name_(host_name),
     service_name_(service_name)
 {
   typename InternetProtocol::endpoint endpoint;
   hints_.ai_flags = flags;
   hints_.ai_family = PF_UNSPEC;
   hints_.ai_socktype = endpoint.protocol().type();
   hints_.ai_protocol = endpoint.protocol().protocol();
   hints_.ai_addrlen = 0;
   hints_.ai_canonname = 0;
   hints_.ai_addr = 0;
   hints_.ai_next = 0;
 }
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:17,代码来源:basic_resolver_query.hpp


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