• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ protocol_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中protocol_type的典型用法代码示例。如果您正苦于以下问题:C++ protocol_type类的具体用法?C++ protocol_type怎么用?C++ protocol_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: open

 // Open a new socket implementation.
 asio::error_code open(implementation_type& impl,
     const protocol_type& protocol, asio::error_code& ec)
 {
   if (!do_open(impl, protocol.family(),
         protocol.type(), protocol.protocol(), ec))
     impl.protocol_ = protocol;
   return ec;
 }
开发者ID:GeorgeShaw,项目名称:resiprocate,代码行数:9,代码来源:reactive_socket_service.hpp


示例2: open

 // Open a new socket implementation.
 asio::error_code open(implementation_type& impl,
     const protocol_type& protocol, asio::error_code& ec)
 {
   if (!do_open(impl, protocol.family(),
         protocol.type(), protocol.protocol(), ec))
   {
     impl.protocol_ = protocol;
     impl.have_remote_endpoint_ = false;
     impl.remote_endpoint_ = endpoint_type();
   }
   return ec;
 }
开发者ID:zpzxgcr,项目名称:mongo,代码行数:13,代码来源:win_iocp_socket_service.hpp


示例3: basic_resolver_query

 /**
  * This constructor is typically used to perform name resolution for local
  * service binding with a specific protocol version.
  *
  * @param protocol A protocol object, normally representing either the IPv4 or
  * IPv6 version of an internet protocol.
  *
  * @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 protocol_type& protocol,
     const std::string& service_name,
     resolver_query_base::flags resolve_flags = passive | address_configured)
   : hints_(),
     host_name_(),
     service_name_(service_name)
 {
   hints_.ai_flags = static_cast<int>(resolve_flags);
   hints_.ai_family = protocol.family();
   hints_.ai_socktype = protocol.type();
   hints_.ai_protocol = protocol.protocol();
   hints_.ai_addrlen = 0;
   hints_.ai_canonname = 0;
   hints_.ai_addr = 0;
   hints_.ai_next = 0;
 }
开发者ID:barrbrain,项目名称:asio,代码行数:35,代码来源:basic_resolver_query.hpp


示例4: basic_resolver_query

 /// Construct with specified host name and service name for a given protocol.
 basic_resolver_query(const protocol_type& protocol,
     const std::string& host_name, const std::string& service_name,
     int flags = address_configured)
   : hints_(),
     host_name_(host_name),
     service_name_(service_name)
 {
   hints_.ai_flags = flags;
   hints_.ai_family = protocol.family();
   hints_.ai_socktype = protocol.type();
   hints_.ai_protocol = protocol.protocol();
   hints_.ai_addrlen = 0;
   hints_.ai_canonname = 0;
   hints_.ai_addr = 0;
   hints_.ai_next = 0;
 }
开发者ID:Sukumi,项目名称:python-libtorrent,代码行数:17,代码来源:basic_resolver_query.hpp


示例5: assign

 // Assign a native socket to a socket implementation.
 asio::error_code assign(implementation_type& impl,
     const protocol_type& protocol, const native_handle_type& native_socket,
     asio::error_code& ec)
 {
   if (!do_assign(impl, protocol.type(), native_socket, ec))
     impl.protocol_ = protocol;
   return ec;
 }
开发者ID:GeorgeShaw,项目名称:resiprocate,代码行数:9,代码来源:reactive_socket_service.hpp


示例6: open

 void open(implementation_type& impl, const protocol_type& protocol,
     Error_Handler error_handler)
 {
   if (protocol.type() == SOCK_STREAM)
     service_impl_.open(impl, protocol, error_handler);
   else
     error_handler(asio::error(asio::error::invalid_argument));
 }
开发者ID:jayp,项目名称:Rappel,代码行数:8,代码来源:stream_socket_service.hpp


示例7: assign

 // Assign a native socket to a socket implementation.
 asio::error_code assign(implementation_type& impl,
     const protocol_type& protocol, const native_handle_type& native_socket,
     asio::error_code& ec)
 {
   if (!do_assign(impl, protocol.type(), native_socket, ec))
   {
     impl.protocol_ = protocol;
     impl.have_remote_endpoint_ = native_socket.have_remote_endpoint();
     impl.remote_endpoint_ = native_socket.remote_endpoint();
   }
   return ec;
 }
开发者ID:zpzxgcr,项目名称:mongo,代码行数:13,代码来源:win_iocp_socket_service.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ps_output类代码示例发布时间:2022-05-31
下一篇:
C++ protein类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap