Output module writing data to a FileHandle using the provided Writer. If using the default ConnectedDgramWriter the filehandle must be writable, connected and able to handle complete datagrams. More...
#include <senf/PPI/SocketSink.hh>
Classes | |
struct | TxStats |
Public Types | |
typedef Writer::Handle | Handle |
Handle type requested by writer. More... | |
Public Member Functions | |
PassiveSocketSink () | |
Create non-connected writer. More... | |
PassiveSocketSink (Writer const &writer) | |
Create non-connected writer. More... | |
PassiveSocketSink (Handle const &handle) | |
Create new writer for the given handle. More... | |
PassiveSocketSink (Handle const &handle, Writer const &writer) | |
Create new writer for the given handle. More... | |
Writer & | writer () |
Access the Writer. More... | |
Handle & | handle () |
Access handle. More... | |
void | handle (Handle const &handle) |
Set handle. More... | |
TxStats & | txStats () |
Public Member Functions inherited from senf::ppi::module::Module | |
virtual | ~Module () |
Public Attributes | |
connector::PassiveInput< typename Writer::PacketType > | input |
Input connector from which data is received. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from senf::ppi::module::Module | |
Module () | |
Route< connector::InputConnector, connector::OutputConnector > & | route (connector::InputConnector &input, connector::OutputConnector &output) |
Define flow information. More... | |
Route< connector::InputConnector, EventDescriptor > & | route (connector::InputConnector &input, EventDescriptor &output) |
Define flow information. More... | |
Route< EventDescriptor, connector::OutputConnector > & | route (EventDescriptor &input, connector::OutputConnector &output) |
Define flow information. More... | |
void | noroute (connector::Connector &connector) |
Define terminal connectors. More... | |
template<class Target > | |
void | registerEvent (EventDescriptor &descriptor, Target target) |
Register an external event. More... | |
ClockService::clock_type const & | time () const |
Time-stamp of the currently processing event. More... | |
ClockService::clock_type const & | now () const |
Current time of the currently processing event. More... | |
virtual void | v_init () |
Called after module setup. More... | |
console::DirectoryNode & | sysConsoleDir () const |
void | destroy () |
Output module writing data to a FileHandle using the provided Writer. If using the default ConnectedDgramWriter the filehandle must be writable, connected and able to handle complete datagrams.
This output module will write data to a FileHandle object using a given Writer. This output module is passive. This implies, that the output handle may not block. This also implies, that data will probably get lost if written to fast for the underlying transport mechanism. Either this is desired (like for a UDP socket) or some additional bandwidth shaping needs to be used.
The default Writer is senf::ppi::ConnectedDgramWriter which will write out the complete packet to the file handle.
The Writer must fulfill the following interface:
Whenever a packet is received for sending, the Writer's operator()
is called.
Definition at line 300 of file SocketSink.hh.
typedef Writer::Handle senf::ppi::module::PassiveSocketSink< Writer >::Handle |
Handle type requested by writer.
Definition at line 302 of file SocketSink.hh.
senf::ppi::module::PassiveSocketSink< Writer >::PassiveSocketSink | ( | ) |
Create non-connected writer.
The writer will be disabled until a socket is set
|
explicit |
Create non-connected writer.
The writer will be disabled until a socket is set
[in] | writer | Writer helper writing packet date to the socket |
|
explicit |
Create new writer for the given handle.
Data will be written to handle using Writer.
[in] | handle | Handle to write data to |
senf::ppi::module::PassiveSocketSink< Writer >::PassiveSocketSink | ( | Handle const & | handle, |
Writer const & | writer | ||
) |
Create new writer for the given handle.
Data will be written to handle using Writer.
[in] | handle | Handle to write data to |
[in] | writer | Writer helper writing packet date to the socket |
Handle& senf::ppi::module::PassiveSocketSink< Writer >::handle | ( | ) |
Access handle.
void senf::ppi::module::PassiveSocketSink< Writer >::handle | ( | Handle const & | handle | ) |
Set handle.
Assigning an empty or in-valid() handle will disable the module until a new valid handle is assigned.
|
inline |
Definition at line 354 of file SocketSink.hh.
Writer& senf::ppi::module::PassiveSocketSink< Writer >::writer | ( | ) |
Access the Writer.
connector::PassiveInput<typename Writer::PacketType> senf::ppi::module::PassiveSocketSink< Writer >::input |
Input connector from which data is received.
Definition at line 307 of file SocketSink.hh.