예제 #1
0
 /**
  * This constructor is typically used to perform name resolution for
  * communication with remote hosts.
  *
  * @param host A string identifying a location. May be a descriptive name or
  * a numeric address string. If an empty string and the passive flag has been
  * specified, the resolved endpoints are suitable for local service binding.
  * If an empty string and passive is not specified, the resolved endpoints
  * will use the loopback address.
  *
  * @param service A string identifying the requested service. This may be a
  * descriptive name or a numeric string corresponding to a port number. May
  * be an empty string, in which case all resolved endpoints will have a port
  * number of 0.
  *
  * @param resolve_flags A set of flags that determine how name resolution
  * should be performed. The default flags are suitable for communication with
  * remote hosts.
  *
  * @note On POSIX systems, host names may be locally defined in the file
  * <tt>/etc/hosts</tt>. On Windows, host names may be defined in the file
  * <tt>c:\\windows\\system32\\drivers\\etc\\hosts</tt>. Remote host name
  * resolution is performed using DNS. Operating systems may use additional
  * locations when resolving host names (such as NETBIOS names on Windows).
  *
  * 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& host, const std::string& service,
     resolver_query_base::flags resolve_flags = address_configured)
   : hints_(),
     host_name_(host),
     service_name_(service)
 {
   typename InternetProtocol::endpoint endpoint;
   hints_.ai_flags = static_cast<int>(resolve_flags);
   hints_.ai_family = ASIO_OS_DEF(AF_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;
 }
예제 #2
0
파일: io_control.hpp 프로젝트: DINKIN/mongo
 // Get the name of the IO control command.
 int name() const
 {
   return static_cast<int>(ASIO_OS_DEF(FIONREAD));
 }
예제 #3
0
 /// Obtain an identifier for the type of the protocol.
 int type() const
 {
   return ASIO_OS_DEF(SOCK_DGRAM);
 }
예제 #4
0
파일: icmp.hpp 프로젝트: damu/asio
 /// Construct to represent the IPv6 ICMP protocol.
 static icmp v6()
 {
   return icmp(ASIO_OS_DEF(IPPROTO_ICMPV6),
       ASIO_OS_DEF(AF_INET6));
 }
예제 #5
0
파일: icmp.hpp 프로젝트: damu/asio
 /// Obtain an identifier for the type of the protocol.
 int type() const
 {
   return ASIO_OS_DEF(SOCK_RAW);
 }
예제 #6
0
 /// Obtain an identifier for the type of the protocol.
 int type() const
 {
   return ASIO_OS_DEF(SOCK_STREAM);
 }
예제 #7
0
파일: icmp.hpp 프로젝트: damu/asio
 /// Construct to represent the IPv4 ICMP protocol.
 static icmp v4()
 {
   return icmp(ASIO_OS_DEF(IPPROTO_ICMP),
       ASIO_OS_DEF(AF_INET));
 }
예제 #8
0
 /// Obtain an identifier for the protocol.
 int protocol() const
 {
   return ASIO_OS_DEF(IPPROTO_TCP);
 }
예제 #9
0
파일: endpoint.hpp 프로젝트: damu/asio
 // Determine whether the endpoint is IPv4.
 bool is_v4() const
 {
   return data_.base.sa_family == ASIO_OS_DEF(AF_INET);
 }
예제 #10
0
 /// Construct to represent the IPv6 TCP protocol.
 static tcp v6()
 {
   return tcp(ASIO_OS_DEF(AF_INET6));
 }
예제 #11
0
 /// Construct to represent the IPv4 TCP protocol.
 static tcp v4()
 {
   return tcp(ASIO_OS_DEF(AF_INET));
 }
예제 #12
0
파일: udp.hpp 프로젝트: 0xbda2d2f8/asio
 /// Construct to represent the IPv6 UDP protocol.
 static udp v6()
 {
   return udp(ASIO_OS_DEF(AF_INET6));
 }
예제 #13
0
파일: udp.hpp 프로젝트: 0xbda2d2f8/asio
 /// Construct to represent the IPv4 UDP protocol.
 static udp v4()
 {
   return udp(ASIO_OS_DEF(AF_INET));
 }
예제 #14
0
 /// Obtain an identifier for the type of the protocol.
 int type() const
 {
   return ASIO_OS_DEF(SOCK_SEQPACKET);
 }