UDPSocketProtocol.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
18 #include "UDPSocketProtocol.hh"
19 //#include "UDPSocketProtocol.ih"
20 
21 // Custom includes
22 #include <sys/ioctl.h>
23 #include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
24 
25 //#include "UDPSocketProtocol.mpp"
26 #define prefix_
27 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 
30  const
31 {
32  int n;
33  if (::ioctl(fd(),SIOCINQ,&n) < 0)
34  SENF_THROW_SYSTEM_EXCEPTION("could not call ::ioctl(SIOCINQ) in UDPSocketProtocol::available()");
35  return n;
36 }
37 
39  const
40 {
41  return false;
42 }
43 
44 //-/////////////////////////////////////////////////////////////////////////////////////////////////
45 #undef prefix_
46 //#include "UDPSocketProtocol.mpp"
47 
48 
49 // Local Variables:
50 // mode: c++
51 // fill-column: 100
52 // c-file-style: "senf"
53 // indent-tabs-mode: nil
54 // ispell-local-dictionary: "american"
55 // compile-command: "scons -u test"
56 // comment-column: 40
57 // End:
#define SENF_THROW_SYSTEM_EXCEPTION(desc)
int fd() const
Get file descriptor.
unsigned available() const
Return (maximum) number of bytes available for reading without < blocking.
UDPSocketProtocol public header.
#define prefix_
bool eof() const
Check for end-of-file condition.