Merged revisions 570-575,577-578 via svnmerge from
[senf.git] / Socket / BufferingPolicy.cc
index e1c3171..19cb69f 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 //
-// Copyright (C) 2006 
+// Copyright (C) 2006
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
 //     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
@@ -20,7 +20,9 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-// Definition of non-inline non-template functions
+/** \file
+    \brief BufferingPolicy non-inline non-template implementation
+ */
 
 #include "BufferingPolicy.hh"
 //#include "BufferingPolicy.ih"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <errno.h>
-#include "Utils/Exception.hh"
+#include "../Utils/Exception.hh"
 
 //#include "BufferingPolicy.mpp"
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-prefix_ unsigned satcom::lib::SocketBufferingPolicy::rcvbuf(FileHandle handle)
+prefix_ unsigned senf::SocketBufferingPolicy::rcvbuf(FileHandle handle)
 {
     unsigned size;
     socklen_t len (sizeof(size));
     if (::getsockopt(handle.fd(),SOL_SOCKET,SO_RCVBUF,&size,&len) < 0)
-        throw SystemException(errno);
+        throwErrno();
     // Linux doubles the bufer size on setting the RCVBUF to cater for internal
     // headers. We fix this up here .. (see lkml FAQ)
     return size/2;
 }
 
-prefix_ void satcom::lib::SocketBufferingPolicy::rcvbuf(FileHandle handle, unsigned size)
+prefix_ void senf::SocketBufferingPolicy::rcvbuf(FileHandle handle, unsigned size)
 {
     if (::setsockopt(handle.fd(),SOL_SOCKET,SO_RCVBUF,&size,sizeof(size)) < 0)
-        throw SystemException(errno);
+        throwErrno();
 }
 
-prefix_ unsigned satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle)
+prefix_ unsigned senf::SocketBufferingPolicy::sndbuf(FileHandle handle)
 {
     unsigned size;
     socklen_t len (sizeof(size));
     if (::getsockopt(handle.fd(),SOL_SOCKET,SO_SNDBUF,&size,&len) < 0)
-        throw SystemException(errno);
+        throwErrno();
     // Linux doubles the bufer size on setting the SNDBUF to cater for internal
     // headers. We fix this up here .. (see lkml FAQ)
     return size/2;
-    
+
 }
 
-prefix_ void satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle, unsigned size)
+prefix_ void senf::SocketBufferingPolicy::sndbuf(FileHandle handle, unsigned size)
 {
     if (::setsockopt(handle.fd(),SOL_SOCKET,SO_SNDBUF,&size,sizeof(size)) < 0)
-        throw SystemException(errno);
+        throwErrno();
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////
@@ -77,5 +79,10 @@ prefix_ void satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle, unsig
 \f
 // Local Variables:
 // mode: c++
-// c-file-style: "satcom"
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
 // End: