Utils: Removed ErrnoException and implemented generic Exception base-class
[senf.git] / Socket / Protocols / INet / UDPSocketHandle.cc
index 35caf99..f51fe6b 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
@@ -46,8 +46,8 @@ prefix_ void senf::UDPv4SocketProtocol::init_client()
 {
     int sock = ::socket(PF_INET,SOCK_DGRAM,0);
     if (sock < 0)
-        throw SystemException(errno);
-    body().fd(sock);
+        throw SystemException();
+    fd(sock);
 }
 
 prefix_ void
@@ -55,13 +55,7 @@ senf::UDPv4SocketProtocol::init_client(INet4SocketAddress const & address)
     const
 {
     init_client();
-    bind(address);
-}
-
-prefix_ std::auto_ptr<senf::SocketProtocol> senf::UDPv4SocketProtocol::clone()
-    const
-{
-    return std::auto_ptr<SocketProtocol>(new UDPv4SocketProtocol());
+    clientHandle().bind(address);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -72,8 +66,8 @@ prefix_ void senf::UDPv6SocketProtocol::init_client()
 {
     int sock = ::socket(PF_INET6,SOCK_DGRAM,0);
     if (sock < 0)
-        throw SystemException(errno);
-    body().fd(sock);
+        throw SystemException();
+    fd(sock);
 }
 
 prefix_ void
@@ -81,13 +75,7 @@ senf::UDPv6SocketProtocol::init_client(INet6SocketAddress const & address)
     const
 {
     init_client();
-    bind(address);
-}
-
-prefix_ std::auto_ptr<senf::SocketProtocol> senf::UDPv6SocketProtocol::clone()
-    const
-{
-    return std::auto_ptr<SocketProtocol>(new UDPv6SocketProtocol());
+    clientHandle().bind(address);
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////