Utils: Removed ErrnoException and implemented generic Exception base-class
[senf.git] / Socket / Protocols / INet / UDPSocketHandle.cc
index 28947ca..f51fe6b 100644 (file)
@@ -1,8 +1,8 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+// 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
@@ -46,7 +46,7 @@ prefix_ void senf::UDPv4SocketProtocol::init_client()
 {
     int sock = ::socket(PF_INET,SOCK_DGRAM,0);
     if (sock < 0)
-        throwErrno();
+        throw SystemException();
     fd(sock);
 }
 
@@ -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,7 +66,7 @@ prefix_ void senf::UDPv6SocketProtocol::init_client()
 {
     int sock = ::socket(PF_INET6,SOCK_DGRAM,0);
     if (sock < 0)
-        throwErrno();
+        throw SystemException();
     fd(sock);
 }
 
@@ -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////////////////////////////////////////