4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief UDPv4SocketHandle and UDPv6SocketHandle public header
26 \todo Implement possibly non-blocking connect and SO_ERROR in the
30 #ifndef HH_ConnectedUDPSocketHandle_
31 #define HH_ConnectedUDPSocketHandle_ 1
34 #include "INetProtocol.hh"
35 #include "UDPProtocol.hh"
36 #include "../../../Socket/Protocols/BSDSocketProtocol.hh"
37 #include "../../../Socket/FramingPolicy.hh"
38 #include "../../../Socket/CommunicationPolicy.hh"
39 #include "../../../Socket/ReadWritePolicy.hh"
40 #include "../../../Socket/ProtocolClientSocketHandle.hh"
42 //#include "ConnectedUDPSocketHandle.mpp"
43 ///////////////////////////////hh.p////////////////////////////////////////
47 /// \addtogroup concrete_protocol_group
50 typedef MakeSocketPolicy<
51 INet4AddressingPolicy,
52 DatagramFramingPolicy,
53 ConnectedCommunicationPolicy,
56 >::policy ConnectedUDPv4Socket_Policy; ///< Socket Policy of the UDPv4 Protocol
58 /** \brief IPv4 UDP Socket Protocol, connected
60 \par Socket Handle typedefs:
61 \ref ConnectedUDPv4ClientSocketHandle (ProtocolClientSocketHandle)
63 \par Policy Interface:
64 ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
65 ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(),
66 ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
71 ConnectedUDPv4SocketProtocol provides an internet protocol stream socket based on the UDP
72 protocol and IPv4 addressing.
74 This class is utilized as the protocol class of the ProtocolClientSocketHandle
75 via the Socket Handle typedefs above.
77 \see ConnectedUDPv6SocketProtocol
79 class ConnectedUDPv4SocketProtocol
80 : public ConcreteSocketProtocol<ConnectedUDPv4Socket_Policy, ConnectedUDPv4SocketProtocol>,
82 public BSDSocketProtocol,
83 public AddressableBSDSocketProtocol
86 ///////////////////////////////////////////////////////////////////////////
92 void init_client() const; ///< Create unconnected client socket
93 /**< \note This member is implicitly called from the
94 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
96 void init_client(INet4SocketAddress const & address) const;
97 ///< Create client socket and connect
98 /**< Creates a new client socket and connects to the given
101 \param[in] address remote address to connect to */
102 /**< \note This member is implicitly called from the
103 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
109 typedef ProtocolClientSocketHandle<
110 ConnectedUDPv4SocketProtocol> ConnectedUDPv4ClientSocketHandle;
112 typedef MakeSocketPolicy<
113 ConnectedUDPv4Socket_Policy,
114 INet6AddressingPolicy
115 >::policy ConnectedUDPv6Socket_Policy;
117 /** \brief IPv6 UDP Socket Protocol, connected
119 \par Socket Handle typedefs:
120 \ref ConnectedUDPv6ClientSocketHandle (ProtocolClientSocketHandle)
122 \par Policy Interface:
123 ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
124 ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(),
125 ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
130 ConnectedUDPv6SocketProtocol provides an internet protocol stream socket based on the UDP
131 protocol and IPv6 addressing.
133 This class is utilized as the protocol class of the ProtocolClientSocketHandle
134 via the Socket Handle typedefs above.
136 \see ConnectedUDPv4SocketProtocol
138 class ConnectedUDPv6SocketProtocol
139 : public ConcreteSocketProtocol<ConnectedUDPv6Socket_Policy, ConnectedUDPv6SocketProtocol>,
141 public BSDSocketProtocol,
142 public AddressableBSDSocketProtocol
145 ///////////////////////////////////////////////////////////////////////////
146 // internal interface
148 ///\name Constructors
151 void init_client() const; ///< Create unconnected client socket
152 /**< \note This member is implicitly called from the
153 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
155 void init_client(INet6SocketAddress const & address) const;
156 ///< Create client socket and connect
157 /**< Creates a new client socket and connects to the given
160 \param[in] address remote address to connect to */
161 /**< \note This member is implicitly called from the
162 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
168 typedef ProtocolClientSocketHandle<
169 ConnectedUDPv6SocketProtocol> ConnectedUDPv6ClientSocketHandle;
175 ///////////////////////////////hh.e////////////////////////////////////////
176 //#include "ConnectedUDPSocketHandle.cci"
177 //#include "ConnectedUDPSocketHandle.ct"
178 //#include "ConnectedUDPSocketHandle.cti"
185 // c-file-style: "senf"
186 // indent-tabs-mode: nil
187 // ispell-local-dictionary: "american"
188 // compile-command: "scons -u test"
189 // comment-column: 40