-// $Id$
-//
// Copyright (C) 2007
+// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
+// Kompetenzzentrum NETwork research (NET)
+// David Wagner <david.wagner@fokus.fraunhofer.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
// Custom includes
#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
#include "../../../Utils/Exception.hh"
//#include "UNProtocol.mpp"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
+prefix_ unsigned senf::UNProtocol::available()
+ const
+{
+ int n;
+ if (::ioctl(body().fd(),SIOCINQ,&n) < 0)
+ throw senf::SystemException(errno);
+ return n;
+}
+
+prefix_ bool senf::UNProtocol::eof()
+ const
+{
+ return false;
+}
+
prefix_ void senf::UNProtocol::connect(UNSocketAddress const & address)
const
{