#include <senf/Socket/Protocols/INet/UDPSocketProtocol.hh>
This protocol facet provides all those protocol functions, which are available on any UDP socket.
Definition at line 46 of file UDPSocketProtocol.hh.
Abstract Interface Implementation |
|
unsigned | available () const |
Return (maximum) number of bytes available for reading < without < blocking. |
|
bool | eof () const |
Check for end-of-file condition. |
unsigned senf::UDPSocketProtocol:: | ||||
available | () | |||
Return (maximum) number of bytes available for reading < without < blocking.
This member will check in a (very, sigh) protocol dependent way, how many bytes may be read from a socket in a single (non-blocking) read operation. If the socket does not support reading (viz. NotReadablePolicy is set), this member should always return 0
.
Depending on the protocol, it may not be possible to return a good value. In this case, an upper bound may be returned (e.g.: When reading from a socket which returns ethernet frames, returning 1500 from available() is ok). However, this should only be done as a last resort. Also beware, that this number should not be too large since the socket layer will always need to allocate that number of bytes for the data to be read.
Implements senf::SocketProtocol.
Definition at line 38 of file UDPSocketProtocol.cc.
bool senf::UDPSocketProtocol:: | ||||
eof | () | |||
Check for end-of-file condition.
This is another check which (like available()) is extremely protocol dependent. This member will return true
only, if at end-of-file. If the protocol does not support the notion of EOF, this member should always return false
.
Implements senf::SocketProtocol.
Definition at line 47 of file UDPSocketProtocol.cc.