Merged revisions 570-572,574-575,578-579,581-595,598-611 via svnmerge from
[senf.git] / Socket / Protocols / INet / UDPSocketHandle.hh
index 1a1e93d..13673e8 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+//     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // Custom includes
 #include "INetProtocol.hh"
 #include "UDPProtocol.hh"
-#include "Socket/Protocols/BSDSocketProtocol.hh"
-#include "Socket/FramingPolicy.hh"
-#include "Socket/CommunicationPolicy.hh"
-#include "Socket/ReadWritePolicy.hh"
-#include "Socket/BufferingPolicy.hh"
-#include "Socket/ProtocolClientSocketHandle.hh"
+#include "MulticastProtocol.hh"
+#include "../../../Socket/Protocols/BSDSocketProtocol.hh"
+#include "../../../Socket/Protocols/DatagramSocketProtocol.hh"
+#include "../../../Socket/FramingPolicy.hh"
+#include "../../../Socket/CommunicationPolicy.hh"
+#include "../../../Socket/ReadWritePolicy.hh"
+#include "../../../Socket/ProtocolClientSocketHandle.hh"
 
 //#include "UDPSocketHandle.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -53,22 +54,21 @@ namespace senf {
         DatagramFramingPolicy,
         UnconnectedCommunicationPolicy,
         ReadablePolicy,
-        WriteablePolicy,
-        SocketBufferingPolicy
+        WriteablePolicy
         >::policy UDPv4Socket_Policy;   ///< Socket Policy of the UDPv4 Protocol
 
     /** \brief IPv4 UDP Socket Protocol
 
         \par Socket Handle typedefs:
-        \ref UDPv4ClientSocketHandle (ProtocolClientSocketHandle)
+            \ref UDPv4ClientSocketHandle (ProtocolClientSocketHandle)
 
         \par Policy Interface:
-        ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
-        ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(),
-        ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
+            ClientSocketHandle::read(), ClientSocketHandle::readfrom(),
+            ClientSocketHandle::writeto(), ClientSocketHandle::bind(), ClientSocketHandle::local(),
+            ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
 
         \par Address Type:
-        INet4Address
+            INet4Address
 
         UDPv4SocketProtocol provides an internet protocol stream socket based on the UDP protocol
         and IPv4 addressing.
@@ -82,7 +82,10 @@ namespace senf {
         : public ConcreteSocketProtocol<UDPv4Socket_Policy>,
           public IPv4Protocol,
           public UDPProtocol,
+          public MulticastProtocol,
+          public INet4MulticastProtocol,
           public BSDSocketProtocol,
+          public DatagramSocketProtocol,
           public AddressableBSDSocketProtocol,
           public senf::pool_alloc_mixin<UDPv4SocketProtocol>
     {
@@ -97,14 +100,13 @@ namespace senf {
                                         /**< \note This member is implicitly called from the
                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
                                              constructor */
-        void init_client(INet4Address const & address) const;
-                                        ///< Create client socket and connect
-                                        /**< Creates a new client socket and connects to the given
+        void init_client(INet4SocketAddress const & address) const;
+                                        ///< Create client socket and bind
+                                        /**< Creates a new client socket and bind to the given
                                              address.
-
-                                             \param[in] address remote address to connect to */
+                                             \param[in] address local address to bind to */
                                         /**< \note This member is implicitly called from the
-                                             ProtocolClientSocketHandle::ProtocolClientSocketHandle()
+                                            ProtocolClientSocketHandle::ProtocolClientSocketHandle()
                                              constructor */
 
         ///@}
@@ -113,6 +115,7 @@ namespace senf {
         std::auto_ptr<SocketProtocol> clone() const;
 
         ///@}
+
     };
 
     typedef ProtocolClientSocketHandle<UDPv4SocketProtocol> UDPv4ClientSocketHandle;
@@ -127,13 +130,13 @@ namespace senf {
         \par Socket Handle typedefs:
         \ref UDPv6ClientSocketHandle (ProtocolClientSocketHandle)
 
-        \par Policy Interface:
-        ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
-        ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(),
-        ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
+        \par Policy Interface: 
+            ClientSocketHandle::read(), ClientSocketHandle::readfrom(),
+            ClientSocketHandle::writeto(), ClientSocketHandle::bind(), ClientSocketHandle::local(),
+            ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
 
         \par Address Type:
-        INet6Address
+            INet6Address
 
         UDPv6SocketProtocol provides an internet protocol stream socket based on the UDP protocol
         and IPv6 addressing.
@@ -147,7 +150,10 @@ namespace senf {
         : public ConcreteSocketProtocol<UDPv6Socket_Policy>,
           public IPv6Protocol,
           public UDPProtocol,
+          public MulticastProtocol,
+          public INet6MulticastProtocol,
           public BSDSocketProtocol,
+          public DatagramSocketProtocol,
           public AddressableBSDSocketProtocol,
           public senf::pool_alloc_mixin<UDPv6SocketProtocol>
     {
@@ -164,10 +170,9 @@ namespace senf {
                                              constructor */
         void init_client(INet6SocketAddress const & address) const;
                                         ///< Create client socket and connect
-                                        /**< Creates a new client socket and connects to the given
+                                        /**< Creates a new client socket and bind to the given
                                              address.
-
-                                             \param[in] address remote address to connect to */
+                                             \param[in] address local address to bind to */
                                         /**< \note This member is implicitly called from the
                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
                                              constructor */