Merged revisions 570-572,574-575,578-579,581-595,598-611 via svnmerge from
[senf.git] / Socket / Protocols / UN / UNDatagramSocketHandle.cc
index 360ec03..77408fa 100644 (file)
@@ -1,6 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2007 
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+//     David Wagner <dw6@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
@@ -38,14 +41,20 @@ prefix_ void senf::UNDatagramSocketProtocol::init_client() const
 {
     int sock = ::socket(PF_UNIX,SOCK_DGRAM,0);
     if (sock < 0)
-        throw SystemException(errno);
-    body().fd(sock);
+        throwErrno();
+    fd(sock);
 }
 
-prefix_ void senf::UNDatagramSocketProtocol::init_client(UNSocketAddress const & address) const
+prefix_ void senf::UNDatagramSocketProtocol::init_client(UNSocketAddress const & address) const 
 {
     init_client();
-    //bind(address);
+    clientHandle().bind(address);
+}
+
+prefix_ std::auto_ptr<senf::SocketProtocol> senf::UNDatagramSocketProtocol::clone()
+    const
+{
+    return std::auto_ptr<SocketProtocol>(new UNDatagramSocketProtocol());
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////