Socket: Move protocol into the socket body (as private base class) and allow non...
[senf.git] / Socket / ServerSocketHandle.cti
index 715a9a6..e0e133f 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
@@ -48,8 +48,8 @@ ServerSocketHandle(ServerSocketHandle<OtherPolicy> other,
 
 template <class SocketPolicy>
 prefix_  senf::ServerSocketHandle<SocketPolicy>::
-ServerSocketHandle(std::auto_ptr<SocketProtocol> protocol)
-    : SocketHandle<SocketPolicy>(protocol,true)
+ServerSocketHandle(std::auto_ptr<SocketBody> body)
+    : SocketHandle<SocketPolicy>(body)
 {}
 
 template <class SocketPolicy>
@@ -95,8 +95,8 @@ template <class Policy>
 prefix_ typename senf::ServerSocketHandle<Policy>::ClientSocketHandle
 senf::ServerSocketHandle<Policy>::accept()
 {
-    Address address;
-    return acceptfrom(address);
+    return ClientSocketHandle(this->body().clone(
+                                  Policy::CommunicationPolicy::accept(*this), false));
 }
 
 template <class Policy>
@@ -106,7 +106,7 @@ senf::ServerSocketHandle<Policy>::acceptfrom()
 {
 
     Address address;
-    ClientSocketHandle handle = accept(address);
+    ClientSocketHandle handle = acceptfrom(address);
     return std::make_pair(handle,address);
 }