Concrete Socket Protocol implementation base class. More...
#include <senf/Socket/SocketProtocol.hh>
Public Types | |
typedef SocketPolicy | Policy |
The protocols policy. More... | |
Public Member Functions | |
Policy const & | policy () const |
Access the policy instance. More... | |
Public Member Functions inherited from senf::SocketProtocol | |
virtual unsigned | available () const =0 |
Return (maximum) number of bytes available for reading without < blocking. More... | |
virtual bool | eof () const =0 |
Check for end-of-file condition. More... | |
virtual void | close () |
Close socket. More... | |
virtual void | terminate () const |
Forcibly close socket. More... | |
virtual void | state (SocketStateMap &map, unsigned lod) const |
Return socket state information. More... | |
int | fd () const |
Get file descriptor. More... | |
SocketProtocol () | |
virtual | ~SocketProtocol ()=0 |
Protected Member Functions | |
ClientSocketHandle< Policy > | clientHandle () const |
Get client handle for associated socket. More... | |
ServerSocketHandle< Policy > | serverHandle () const |
Get server handle for associated socket. More... | |
Protected Member Functions inherited from senf::SocketProtocol | |
FileHandle | fh () const |
Get a FileHandle for this instance. More... | |
void | fd (int) const |
Initialize file descriptor. More... | |
Structors and default members | |
~ConcreteSocketProtocol ()=0 | |
Concrete Socket Protocol implementation base class.
ConcreteSocketProtocol is the base class of a concrete socket protocol implementation. The final protocol class must inherit from ConcreteSocketProtocol. The template argument SocketPolicy must be set to the complete socket policy of the protocol. Self is the name of the final protocol class which inherits this class.
A protocol implementation may define the protocol interface directly. It can also (additionally) make use of multiple inheritance to combine a set of protocol facets into a specific protocol implementation (i.e. TCPv4SocketProtocol inherits from ConcreteSocketProtocol and from the protocol facets IPv4SocketProtocol, TCPSocketProtocol, BSDSocketProtocol and AddressableBSDSocketProtocol). The protocol facets are not concrete protocols themselves, they are combined to build concrete protocols. This structure will remove a lot of code duplication. It is important to ensure, that the protocol facets do not overlap, since otherwise there will be problems resolving overlapping members.
Definition at line 253 of file SocketProtocol.hh.
typedef SocketPolicy senf::ConcreteSocketProtocol< SocketPolicy, Self >::Policy |
The protocols policy.
Definition at line 260 of file SocketProtocol.hh.
|
pure virtual |
|
protected |
Get client handle for associated socket.
Returns a client handle for the socket associated with this protocol instance
|
virtual |
Access the policy instance.
Implements senf::SocketProtocol.
|
protected |
Get server handle for associated socket.
Returns a server handle for the socket associated with this protocol instance