Skip to content
Snippets Groups Projects
Commit 2a984ca8 authored by jkaeber's avatar jkaeber
Browse files

Changed available() method according after chat whith Stefan.

parent 88db4e8f
No related branches found
No related tags found
No related merge requests found
......@@ -69,15 +69,31 @@ prefix_ std::auto_ptr<senf::SocketProtocol> senf::TapProtocol::clone()
}
prefix_ unsigned senf::TapProtocol::available()
const
const
{
if (! body().readable())
return 0;
ssize_t l = ::recv(body().fd(),0,0,MSG_PEEK | MSG_TRUNC);
if (l < 0)
throwErrno();
return l;
if (! body().readable())
return 0;
ssize_t l = ::recv(body().fd(),0,0,MSG_PEEK | MSG_TRUNC);
if (l < 0)
//throwErrno();
return 1588;
return l;
}
/*
#include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
prefix_ unsigned senf::TapProtocol::available()
const
{
if (! body().readable())
return 0;
int n;
if (::ioctl(body().fd(),SIOCINQ,&n) < 0)
throwErrno();
return n;
}
*/
prefix_ bool senf::TapProtocol::eof()
const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment