removed some useless spaces; not very important, I know :)
[senf.git] / Socket / Protocols / INet / TCPProtocol.cc
index 8edb77f..340e76b 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
@@ -33,7 +33,7 @@
 #include <netinet/tcp.h>
 #include <sys/ioctl.h>
 #include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
-#include "Socket/SocketHandle.hh"
+#include "../../../Socket/SocketHandle.hh"
 
 //#include "TCPProtocol.mpp"
 #define prefix_
@@ -44,8 +44,8 @@ prefix_ bool senf::TCPProtocol::nodelay()
 {
     int value;
     socklen_t len (sizeof(value));
-    if (::getsockopt(body().fd(),SOL_TCP,TCP_NODELAY,&value,&len) < 0)
-        throw SystemException(errno);
+    if (::getsockopt(fd(),SOL_TCP,TCP_NODELAY,&value,&len) < 0)
+        throwErrno();
     return value;
 }
 
@@ -53,16 +53,16 @@ prefix_ void senf::TCPProtocol::nodelay(bool value)
     const
 {
     int ivalue (value);
-    if (::setsockopt(body().fd(),SOL_TCP,TCP_NODELAY,&ivalue,sizeof(ivalue)) < 0)
-        throw SystemException(errno);
+    if (::setsockopt(fd(),SOL_TCP,TCP_NODELAY,&ivalue,sizeof(ivalue)) < 0)
+        throwErrno();
 }
 
 prefix_ unsigned senf::TCPProtocol::siocinq()
     const
 {
     int n;
-    if (::ioctl(body().fd(),SIOCINQ,&n) < 0)
-        throw SystemException(errno);
+    if (::ioctl(fd(),SIOCINQ,&n) < 0)
+        throwErrno();
     return n;
 }
 
@@ -70,8 +70,8 @@ prefix_ unsigned senf::TCPProtocol::siocoutq()
     const
 {
     int n;
-    if (::ioctl(body().fd(),SIOCOUTQ,&n) < 0)
-        throw SystemException(errno);
+    if (::ioctl(fd(),SIOCOUTQ,&n) < 0)
+        throwErrno();
     return n;
 }
 
@@ -84,7 +84,7 @@ prefix_ unsigned senf::TCPProtocol::available()
 prefix_ bool senf::TCPProtocol::eof()
     const
 {
-    return body().readable() && available()==0;
+    return fh().readable() && available()==0;
 }