4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // David Wagner <dw6@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 UNDatagramSocketHandle public header */
26 #ifndef HH_UNDatagramSocketHandle_
27 #define HH_UNDatagramSocketHandle_ 1
30 #include "UNAddressing.hh"
31 #include "UNProtocol.hh"
32 #include "../../../Socket/Protocols/BSDSocketProtocol.hh"
33 #include "../../../Socket/FramingPolicy.hh"
34 #include "../../../Socket/CommunicationPolicy.hh"
35 #include "../../../Socket/ReadWritePolicy.hh"
36 #include "../../../Socket/BufferingPolicy.hh"
37 #include "../../../Socket/ProtocolClientSocketHandle.hh"
39 //#include "UNDatagramSocketHandle.mpp"
40 ///////////////////////////////hh.p////////////////////////////////////////
44 /// \addtogroup concrete_protocol_group
47 typedef MakeSocketPolicy<
49 DatagramFramingPolicy,
50 UnconnectedCommunicationPolicy,
54 >::policy UNDatagramSocket_Policy; ///< Socket Policy of the Unix Domain Datagram Protocol
56 /** \brief Unix Domain Datagram Socket Protocol
58 \par Socket Handle typedefs:
59 \ref UNDatagramClientSocketHandle (ProtocolClientSocketHandle)
61 \par Policy Interface: (to be checked)
62 ClientSocketHandle::read(), ClientSocketHandle::readfrom(),
63 ClientSocketHandle::writeto(), ClientSocketHandle::bind(), ClientSocketHandle::local(),
64 ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
69 UNDatagramSocketProtocol provides an datagram protocol socket based on the unix domain
72 This class is utilized as the protocol class of the ProtocolClientSocketHandle via the
73 Socket Handle typedefs above.
75 class UNDatagramSocketProtocol
76 : public ConcreteSocketProtocol<UNDatagramSocket_Policy>,
78 public BSDSocketProtocol,
79 public AddressableBSDSocketProtocol
82 ///////////////////////////////////////////////////////////////////////////
88 void init_client() const; ///< Create unconnected client socket
89 /**< \note This member is implicitly called from the
90 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
92 void init_client(UNSocketAddress const & address) const;
93 ///< Create client socket and bind
94 /**< Creates a new client socket and bind to the given
96 \param[in] address local address to bind to */
97 /**< \note This member is implicitly called from the
98 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
102 ///\name Abstract Interface Implementation
104 std::auto_ptr<SocketProtocol> clone() const;
109 typedef ProtocolClientSocketHandle<UNDatagramSocketProtocol> UNDatagramClientSocketHandle;
114 ///////////////////////////////hh.e////////////////////////////////////////
115 //#include "UNDatagramSocketHandle.cci"
116 //#include "UNDatagramSocketHandle.ct"
117 //#include "UNDatagramSocketHandle.cti"
124 // comment-column: 40
125 // c-file-style: "senf"
126 // indent-tabs-mode: nil
127 // ispell-local-dictionary: "american"
128 // compile-command: "scons -u test"