// $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
#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_
{
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;
}
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;
}
const
{
int n;
- if (::ioctl(body().fd(),SIOCOUTQ,&n) < 0)
- throw SystemException(errno);
+ if (::ioctl(fd(),SIOCOUTQ,&n) < 0)
+ throwErrno();
return n;
}
prefix_ bool senf::TCPProtocol::eof()
const
{
- return body().readable() && available()==0;
+ return fh().readable() && available()==0;
}