TCPSocketHandle.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
21 #ifndef HH_SENF_Socket_Protocols_INet_TCPSocketHandle_
22 #define HH_SENF_Socket_Protocols_INet_TCPSocketHandle_ 1
23 
24 // Custom includes
25 #include "INetSocketProtocol.hh"
26 #include "TCPSocketProtocol.hh"
27 #include "INetAddressing.hh"
34 
35 //#include "TCPSocketHandle.mpp"
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37 
38 namespace senf {
39 
41  //\{
42 
43  typedef MakeSocketPolicy<
44  INet4AddressingPolicy,
45  StreamFramingPolicy,
46  ConnectedCommunicationPolicy,
47  ReadablePolicy,
48  WriteablePolicy
49  >::policy TCPv4Socket_Policy;
50 
73  : public ConcreteSocketProtocol<TCPv4Socket_Policy,TCPv4SocketProtocol>,
74  public TCPSocketProtocol,
75  public BSDSocketProtocol,
77  {
78  public:
79  //-////////////////////////////////////////////////////////////////////////
80  // internal interface
81 
83  //\{
84 
85  void init_client() const;
86 
89  void init_client(INet4SocketAddress const & address) const;
91 
98  void init_server() const;
99 
102  void init_server(INet4SocketAddress const & address, unsigned backlog=1) const;
104 
114  //\}
115  };
116 
119 
120  typedef MakeSocketPolicy<
124 
147  : public ConcreteSocketProtocol<TCPv6Socket_Policy,TCPv6SocketProtocol>,
148  public TCPSocketProtocol,
149  public BSDSocketProtocol,
151  {
152  public:
153  //-////////////////////////////////////////////////////////////////////////
154  // internal interface
155 
157  //\{
158 
159  void init_client() const;
160 
163  void init_client(INet6SocketAddress const & address) const;
165 
172  void init_server() const;
173 
176  void init_server(INet6SocketAddress const & address, unsigned backlog=1) const;
178 
188  //\}
189  };
190 
193 
194  //\}
195 
196 }
197 
198 //-/////////////////////////////////////////////////////////////////////////////////////////////////
199 //#include "TCPSocketHandle.cci"
200 //#include "TCPSocketHandle.ct"
201 //#include "TCPSocketHandle.cti"
202 #endif
203 
204 
205 // Local Variables:
206 // mode: c++
207 // fill-column: 100
208 // c-file-style: "senf"
209 // indent-tabs-mode: nil
210 // ispell-local-dictionary: "american"
211 // compile-command: "scons -u test"
212 // comment-column: 40
213 // End:
void init_client() const
Create unconnected client socket.
Addressing policy supporting IPv6 addressing.
CommunicationPolicy public header.
TCPSocketProtocol public header.
IPv6 socket address.
ProtocolClientSocketHandle public header.
MakeSocketPolicy< INet4AddressingPolicy, StreamFramingPolicy, ConnectedCommunicationPolicy, ReadablePolicy, WriteablePolicy >::policy TCPv4Socket_Policy
Socket Policy of the TCPv4 Protocol.
IPv4 socket address.
IPv[46]Protocol public header.
Protocol specific socket handle (server interface)
ReadPolicy and WritePolicy public header.
Protocol facet to support TCP operations.
Protocol facet providing basic BSD socket functionality.
Protocol facet providing basic connection oriented BSD socket functions.
Protocol specific socket handle (client interface)
BSDSocketProtocol public header.
void init_server() const
Create server socket.
Concrete Socket Protocol implementation base class.
INet[46]Address and INet[46]AddressingPolicy public header.
ProtocolClientSocketHandle< TCPv4SocketProtocol > TCPv4ClientSocketHandle
ProtocolServerSocketHandle public header.
MakeSocketPolicy< TCPv4Socket_Policy, INet6AddressingPolicy >::policy TCPv6Socket_Policy
FramingPolicy public header.
ProtocolServerSocketHandle< TCPv4SocketProtocol > TCPv4ServerSocketHandle
IPv6 TCP Socket Protocol.
IPv4 TCP Socket Protocol.
ProtocolServerSocketHandle< TCPv6SocketProtocol > TCPv6ServerSocketHandle
ProtocolClientSocketHandle< TCPv6SocketProtocol > TCPv6ClientSocketHandle
Metafunction to create SocketPolicy.