FLUTE receiver class. More...
#include <Receiver.h>
Public Types | |
typedef std::function< void(std::shared_ptr< LibFlute::File >)> | completion_callback_t |
Definition of a file reception completion callback function that can be registered through ::register_completion_callback. More... | |
Public Member Functions | |
Receiver (const std::string &iface, const std::string &address, short port, uint64_t tsi, boost::asio::io_service &io_service) | |
Default constructor. More... | |
virtual | ~Receiver () |
Default destructor. More... | |
void | enable_ipsec (uint32_t spi, const std::string &aes_key) |
Enable IPSEC ESP decryption of FLUTE payloads. More... | |
std::vector< std::shared_ptr< LibFlute::File > > | file_list () |
List all current files. More... | |
void | remove_expired_files (unsigned max_age) |
Remove files from the list that are older than max_age seconds. More... | |
void | register_completion_callback (completion_callback_t cb) |
Register a callback for file reception notifications. More... | |
FLUTE receiver class.
Construct an instance of this to receive files from a FLUTE/ALC session.
Definition at line 32 of file Receiver.h.
typedef std::function<void(std::shared_ptr<LibFlute::File>)> LibFlute::Receiver::completion_callback_t |
Definition of a file reception completion callback function that can be registered through ::register_completion_callback.
Definition at line 40 of file Receiver.h.
LibFlute::Receiver::Receiver | ( | const std::string & | iface, |
const std::string & | address, | ||
short | port, | ||
uint64_t | tsi, | ||
boost::asio::io_service & | io_service | ||
) |
Default constructor.
iface | Address of the (local) interface to bind the receiving socket to. 0.0.0.0 = any. |
address | Multicast address |
port | Target port |
tsi | TSI value of the session |
io_service | Boost io_service to run the socket operations in (must be provided by the caller) |
Definition at line 27 of file Receiver.cpp.
|
virtual |
Default destructor.
Definition at line 54 of file Receiver.cpp.
auto LibFlute::Receiver::enable_ipsec | ( | uint32_t | spi, |
const std::string & | aes_key | ||
) |
Enable IPSEC ESP decryption of FLUTE payloads.
spi | Security Parameter Index value to use |
key | AES key as a hex string (without leading 0x). Must be an even number of characters long. |
Definition at line 60 of file Receiver.cpp.
auto LibFlute::Receiver::file_list | ( | ) |
List all current files.
Definition at line 153 of file Receiver.cpp.
|
inline |
Register a callback for file reception notifications.
cb | Function to call on file completion |
Definition at line 84 of file Receiver.h.
auto LibFlute::Receiver::remove_expired_files | ( | unsigned | max_age | ) |
Remove files from the list that are older than max_age seconds.
Definition at line 162 of file Receiver.cpp.