TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Command line arguments for the class UDPReceiver. More...
#include <tsUDPReceiverArgs.h>
Public Member Functions | |
UDPReceiverArgs ()=default | |
Constructor. | |
void | defineArgs (Args &args, bool with_short_options, bool destination_is_parameter) |
Add command line option definitions in an Args. | |
bool | loadArgs (DuckContext &duck, Args &args, cn::milliseconds default_receive_timeout=cn::milliseconds(-1)) |
Load arguments from command line. | |
void | setUnicast (const IPv4SocketAddress &local_address, bool reuse_port=true, size_t buffer_size=0) |
Set application-specified parameters to receive unicast traffic. | |
Public Attributes | |
bool | default_interface = false |
Use default local interface only for multicast (--default-interface). | |
IPv4SocketAddress | destination {} |
Destination of packets to read ([address:]port). | |
IPv4Address | local_address {} |
Optional local addresses on which to listen (--local-address). | |
bool | mc_loopback = true |
Multicast loopback option (--disable-multicast-loop not present). | |
size_t | receive_bufsize = 0 |
Socket receive buffer size in bytes (--buffer-size). | |
cn::milliseconds | receive_timeout = cn::milliseconds(-1) |
Receive timeout (--receive-timeout). | |
bool | receive_timestamps = true |
Get receive timestamps, currently hardcoded, is there a reason to disable it? | |
bool | reuse_port = true |
Reuse port socket option (--no-reuse-port not present). | |
IPv4SocketAddress | source {} |
Optional source (--source address[:port]). | |
bool | use_first_source = false |
Use socket address of first received packet to filter subsequent packets (--first-source). | |
bool | use_ssm = false |
Use source-specific multicast (--ssm or SSM syntax used in destination). | |
Command line arguments for the class UDPReceiver.
void ts::UDPReceiverArgs::setUnicast | ( | const IPv4SocketAddress & | local_address, |
bool | reuse_port = true , |
||
size_t | buffer_size = 0 |
||
) |
Set application-specified parameters to receive unicast traffic.
This method is used when command line parameters are not used.
[in] | local_address | Optional local address and required UDP port. |
[in] | reuse_port | Optional reuse-port option. |
[in] | buffer_size | Optional socket receive buffer size. |
|
inline |
Add command line option definitions in an Args.
[in,out] | args | Command line arguments to update. |
[in] | with_short_options | When true, define one-letter short options. |
[in] | destination_is_parameter | When true, the destination [address:]port is defined as a mandatory parameter. When false, it is defined as option –ip–udp (optional, can be omitted) |
|
inline |
Load arguments from command line.
Args error indicator is set in case of incorrect arguments.
[in,out] | duck | TSDuck execution context. |
[in,out] | args | Command line arguments from which to load the parameters. |
[in] | default_receive_timeout | Default receive timeout in milliseconds. No timeout if zero or negative. |
IPv4SocketAddress ts::UDPReceiverArgs::destination {} |
Destination of packets to read ([address:]port).
The UDP port is mandatory. The IP address is optional. When present, it must be a multicast address. When the IP address is not present, receive unicast packets on the specified UDP port.
IPv4SocketAddress ts::UDPReceiverArgs::source {} |
Optional source (--source address[:port]).
The packets are accepted only is they come from the corresponding source. If the source IP address or source UDP port is unspecified, any address or port is accepted. If use_ssm is true, the source is used in source-specific multicast.