#include <senf/PPI/SocketSink.hh>
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:
class SomeWriter { public: typedef unspecified Handle; // type of handle requested typedef unspecified_type PacketType // type of packet read SomeWriter(); // EITHER default constructible SomeWriter(SomeWriter const & other); // OR copy constructible bool operator()(Handle handle, Packet packet); // insertion function };
operator()
is called.
Definition at line 273 of file SocketSink.hh.
Public Types |
|
typedef Writer::Handle | Handle |
Handle type requested by writer. |
|
Public Member Functions |
|
PassiveSocketSink () | |
Create non-connected writer. |
|
PassiveSocketSink (Writer const &writer) | |
Create non-connected writer. |
|
PassiveSocketSink (Handle const &handle) | |
Create new writer for the given handle. |
|
PassiveSocketSink (Handle const &handle, Writer const &writer) | |
Create new writer for the given handle. |
|
Writer & | writer () |
Access the Writer. |
|
Handle & | handle () |
Access handle. |
|
void | handle (Handle const &handle) |
Set handle. |
|
Public Attributes |
|
connector::PassiveInput < typename Writer::PacketType > |
input |
Input connector from which data is received. |
typedef Writer::Handle senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
Handle | ||||
Handle type requested by writer.
Definition at line 275 of file SocketSink.hh.
senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
PassiveSocketSink | () | |||
Create non-connected writer.
The writer will be disabled until a socket is set
Definition at line 81 of file SocketSink.ct.
senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
PassiveSocketSink | ( | Writer const & | writer | ) |
Create non-connected writer.
The writer will be disabled until a socket is set
[in] | writer | Writer helper writing packet date to the socket |
Definition at line 89 of file SocketSink.ct.
senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
PassiveSocketSink | ( | Handle const & | handle | ) |
Create new writer for the given handle.
Data will be written to handle using Writer.
[in] | handle | Handle to write data to |
Definition at line 98 of file SocketSink.ct.
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 |
Definition at line 107 of file SocketSink.ct.
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.
Definition at line 109 of file SocketSink.cti.
Writer::Handle & senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
handle | () | |||
Access handle.
Definition at line 103 of file SocketSink.cti.
Writer & senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
writer | () | |||
Access the Writer.
Definition at line 97 of file SocketSink.cti.
connector::PassiveInput<typename Writer::PacketType> senf::ppi::module::PassiveSocketSink< Writer >:: | ||||
input | ||||
Input connector from which data is received.
Definition at line 280 of file SocketSink.hh.