Socket: Move protocol into the socket body (as private base class) and allow non...
[senf.git] / Socket / ServerSocketHandle.cti
index 03764f3..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
 #define prefix_ inline
 ///////////////////////////////cti.p///////////////////////////////////////
 
+template <class Policy>
+prefix_ senf::ServerSocketHandle<Policy>::ServerSocketHandle()
+{}
+
 template <class SocketPolicy>
 template <class OtherPolicy>
 prefix_ senf::ServerSocketHandle<SocketPolicy>::
@@ -44,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>
@@ -91,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>
@@ -102,7 +106,7 @@ senf::ServerSocketHandle<Policy>::acceptfrom()
 {
 
     Address address;
-    ClientSocketHandle handle = accept(address);
+    ClientSocketHandle handle = acceptfrom(address);
     return std::make_pair(handle,address);
 }
 
@@ -164,4 +168,6 @@ prefix_ std::string senf::ServerSocketHandle<Policy>::dumpState(unsigned lod)
 // c-file-style: "senf"
 // indent-tabs-mode: nil
 // ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
 // End: