X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cci;h=38bd8fcab7803a531c63e794658f86bcf31f41d5;hb=10985d71f77b627bc4da543d7114feb7c4529329;hp=c25d09f304672a861f1feab403d74931355fbc33;hpb=51044eb18f034c1a059ffe2fb109a422c1cbe251;p=senf.git diff --git a/Socket/SocketHandle.cci b/Socket/SocketHandle.cci index c25d09f..38bd8fc 100644 --- a/Socket/SocketHandle.cci +++ b/Socket/SocketHandle.cci @@ -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 // // This program is free software; you can redistribute it and/or modify @@ -34,26 +34,23 @@ #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// -prefix_ senf::SocketBody::SocketBody(std::auto_ptr protocol, - bool isServer) - : protocol_(protocol), isServer_(isServer) -{ - SENF_ASSERT( ! protocol_->body_ ); - protocol_->body_ = this; -} +prefix_ senf::SocketBody::SocketBody(bool isServer) + : isServer_(isServer) +{} + +prefix_ senf::SocketBody::SocketBody(bool isServer, int fd) + : FileBody(fd), isServer_(isServer) +{} -prefix_ senf::SocketBody::SocketBody(std::auto_ptr protocol, - bool isServer, int fd) - : FileBody(fd), protocol_(protocol), isServer_(isServer) +prefix_ senf::SocketProtocol & senf::SocketBody::protocol() { - SENF_ASSERT( ! protocol_->body_ ); - protocol_->body_ = this; + return const_cast(v_protocol()); } prefix_ senf::SocketProtocol const & senf::SocketBody::protocol() const { - return *protocol_; + return v_protocol(); } prefix_ bool senf::SocketBody::isServer() @@ -61,6 +58,18 @@ prefix_ bool senf::SocketBody::isServer() return isServer_; } +prefix_ std::auto_ptr senf::SocketBody::clone(bool isServer) + const +{ + return protocol().clone(isServer); +} + +prefix_ std::auto_ptr senf::SocketBody::clone(int fd, bool isServer) + const +{ + return protocol().clone(fd, isServer); +} + /////////////////////////////////////////////////////////////////////////// // senf::detail::StreamableString