Realistic 3D camera system
3D camera system components
tcp.hpp
Go to the documentation of this file.
1 //
2 // ip/tcp.hpp
3 // ~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_IP_TCP_HPP
12 #define ASIO_IP_TCP_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
28 
30 
31 namespace asio {
32 namespace ip {
33 
35 
45 class tcp
46 {
47 public:
50 
52  static tcp v4()
53  {
54  return tcp(ASIO_OS_DEF(AF_INET));
55  }
56 
58  static tcp v6()
59  {
60  return tcp(ASIO_OS_DEF(AF_INET6));
61  }
62 
64  int type() const
65  {
66  return ASIO_OS_DEF(SOCK_STREAM);
67  }
68 
70  int protocol() const
71  {
72  return ASIO_OS_DEF(IPPROTO_TCP);
73  }
74 
76  int family() const
77  {
78  return family_;
79  }
80 
83 
86 
89 
90 #if !defined(ASIO_NO_IOSTREAM)
93 #endif // !defined(ASIO_NO_IOSTREAM)
94 
96 
121 #if defined(GENERATING_DOCUMENTATION)
122  typedef implementation_defined no_delay;
123 #else
125  ASIO_OS_DEF(IPPROTO_TCP), ASIO_OS_DEF(TCP_NODELAY)> no_delay;
126 #endif
127 
129  friend bool operator==(const tcp& p1, const tcp& p2)
130  {
131  return p1.family_ == p2.family_;
132  }
133 
135  friend bool operator!=(const tcp& p1, const tcp& p2)
136  {
137  return p1.family_ != p2.family_;
138  }
139 
140 private:
141  // Construct with a specific family.
142  explicit tcp(int protocol_family)
143  : family_(protocol_family)
144  {
145  }
146 
147  int family_;
148 };
149 
150 } // namespace ip
151 } // namespace asio
152 
154 
155 #endif // ASIO_IP_TCP_HPP
basic_stream_socket< tcp > socket
The TCP socket type.
Definition: tcp.hpp:82
Iostream interface for a socket.
static tcp v6()
Construct to represent the IPv6 TCP protocol.
Definition: tcp.hpp:58
Describes an endpoint for a version-independent IP socket.
Encapsulates the flags needed for TCP.
Definition: tcp.hpp:45
#define ASIO_OS_DEF(c)
Provides stream-oriented socket functionality.
static tcp v4()
Construct to represent the IPv4 TCP protocol.
Definition: tcp.hpp:52
basic_resolver< tcp > resolver
The TCP resolver type.
Definition: tcp.hpp:88
basic_socket_iostream< tcp > iostream
The TCP iostream type.
Definition: tcp.hpp:92
asio::detail::socket_option::boolean< ASIO_OS_DEF(IPPROTO_TCP), ASIO_OS_DEF(TCP_NODELAY)> no_delay
Socket option for disabling the Nagle algorithm.
Definition: tcp.hpp:125
Provides the ability to accept new connections.
friend bool operator==(const tcp &p1, const tcp &p2)
Compare two protocols for equality.
Definition: tcp.hpp:129
basic_endpoint< tcp > endpoint
The type of a TCP endpoint.
Definition: tcp.hpp:49
int protocol() const
Obtain an identifier for the protocol.
Definition: tcp.hpp:70
basic_socket_acceptor< tcp > acceptor
The TCP acceptor type.
Definition: tcp.hpp:85
friend bool operator!=(const tcp &p1, const tcp &p2)
Compare two protocols for inequality.
Definition: tcp.hpp:135
int type() const
Obtain an identifier for the type of the protocol.
Definition: tcp.hpp:64
Provides endpoint resolution functionality.
int family() const
Obtain an identifier for the protocol family.
Definition: tcp.hpp:76