4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief UDPv4SocketHandle and UDPv6SocketHandle public header
31 \todo Implement possibly non-blocking connect and SO_ERROR in the
35 #ifndef HH_SENF_Socket_Protocols_INet_ConnectedUDPSocketHandle_
36 #define HH_SENF_Socket_Protocols_INet_ConnectedUDPSocketHandle_ 1
39 #include "INetAddressing.hh"
40 #include "UDPSocketProtocol.hh"
41 #include <senf/Socket/Protocols/BSDSocketProtocol.hh>
42 #include <senf/Socket/Protocols/DatagramSocketProtocol.hh>
43 #include <senf/Socket/FramingPolicy.hh>
44 #include <senf/Socket/CommunicationPolicy.hh>
45 #include <senf/Socket/ReadWritePolicy.hh>
46 #include <senf/Socket/ProtocolClientSocketHandle.hh>
48 //#include "ConnectedUDPSocketHandle.mpp"
49 //-/////////////////////////////////////////////////////////////////////////////////////////////////
53 /// \addtogroup concrete_protocol_group
56 typedef MakeSocketPolicy<
57 INet4AddressingPolicy,
58 DatagramFramingPolicy,
59 ConnectedCommunicationPolicy,
62 >::policy ConnectedUDPv4Socket_Policy; ///< Socket Policy of the UDPv4 Protocol
64 /** \brief IPv4 UDP Socket Protocol, connected
66 \par Socket Handle typedefs:
67 \ref ConnectedUDPv4ClientSocketHandle (ProtocolClientSocketHandle)
69 \par Policy Interface:
70 ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
71 ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer()
76 ConnectedUDPv4SocketProtocol provides an internet protocol stream socket based on the UDP
77 protocol and IPv4 addressing.
79 This class is utilized as the protocol class of the ProtocolClientSocketHandle
80 via the Socket Handle typedefs above.
82 \see ConnectedUDPv6SocketProtocol
84 class ConnectedUDPv4SocketProtocol
85 : public ConcreteSocketProtocol<ConnectedUDPv4Socket_Policy, ConnectedUDPv4SocketProtocol>,
86 public UDPSocketProtocol,
87 public BSDSocketProtocol,
88 public DatagramSocketProtocol,
89 public AddressableBSDSocketProtocol
92 //-////////////////////////////////////////////////////////////////////////
98 void init_client() const; ///< Create unconnected client socket
99 /**< \note This member is implicitly called from the
100 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
102 void init_client(INet4SocketAddress const & address) const;
103 ///< Create client socket and connect
104 /**< Creates a new client socket and connects to the given
107 \param[in] address remote address to connect to */
108 /**< \note This member is implicitly called from the
109 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
115 typedef ProtocolClientSocketHandle<
116 ConnectedUDPv4SocketProtocol> ConnectedUDPv4ClientSocketHandle;
118 typedef MakeSocketPolicy<
119 ConnectedUDPv4Socket_Policy,
120 INet6AddressingPolicy
121 >::policy ConnectedUDPv6Socket_Policy;
123 /** \brief IPv6 UDP Socket Protocol, connected
125 \par Socket Handle typedefs:
126 \ref ConnectedUDPv6ClientSocketHandle (ProtocolClientSocketHandle)
128 \par Policy Interface:
129 ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
130 ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer()
135 ConnectedUDPv6SocketProtocol provides an internet protocol stream socket based on the UDP
136 protocol and IPv6 addressing.
138 This class is utilized as the protocol class of the ProtocolClientSocketHandle
139 via the Socket Handle typedefs above.
141 \see ConnectedUDPv4SocketProtocol
143 class ConnectedUDPv6SocketProtocol
144 : public ConcreteSocketProtocol<ConnectedUDPv6Socket_Policy, ConnectedUDPv6SocketProtocol>,
145 public UDPSocketProtocol,
146 public BSDSocketProtocol,
147 public DatagramSocketProtocol,
148 public AddressableBSDSocketProtocol
151 //-////////////////////////////////////////////////////////////////////////
152 // internal interface
154 ///\name Constructors
157 void init_client() const; ///< Create unconnected client socket
158 /**< \note This member is implicitly called from the
159 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
161 void init_client(INet6SocketAddress const & address) const;
162 ///< Create client socket and connect
163 /**< Creates a new client socket and connects to the given
166 \param[in] address remote address to connect to */
167 /**< \note This member is implicitly called from the
168 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
174 typedef ProtocolClientSocketHandle<
175 ConnectedUDPv6SocketProtocol> ConnectedUDPv6ClientSocketHandle;
181 //-/////////////////////////////////////////////////////////////////////////////////////////////////
182 //#include "ConnectedUDPSocketHandle.cci"
183 //#include "ConnectedUDPSocketHandle.ct"
184 //#include "ConnectedUDPSocketHandle.cti"
191 // c-file-style: "senf"
192 // indent-tabs-mode: nil
193 // ispell-local-dictionary: "american"
194 // compile-command: "scons -u test"
195 // comment-column: 40