GNU Radio 3.3.0 C++ API
|
Read stream from an UDP socket. More...
#include <gr_udp_source.h>
Public Member Functions | |
~gr_udp_source () | |
int | payload_size () |
return the PAYLOAD_SIZE of the socket | |
int | get_port () |
return the port number of the socket | |
int | work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) |
just like gr_block::general_work, only this arranges to call consume_each for you | |
Protected Member Functions | |
gr_udp_source (size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof, bool wait) | |
UDP Source Constructor. | |
Friends | |
gr_udp_source_sptr | gr_make_udp_source (size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof, bool wait) |
Read stream from an UDP socket.
itemsize | The size (in bytes) of the item datatype |
host | The name or IP address of the receiving host; can be NULL, None, or "0.0.0.0" to allow reading from any interface on the host |
port | The port number on which to receive data; use 0 to have the system assign an unused port number |
payload_size | UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) |
eof | Interpret zero-length packet as EOF (default: true) |
wait | Wait for data if not immediately available (default: true) |
gr_udp_source::gr_udp_source | ( | size_t | itemsize, |
const char * | host, | ||
unsigned short | port, | ||
int | payload_size, | ||
bool | eof, | ||
bool | wait | ||
) | [protected] |
UDP Source Constructor.
itemsize | The size (in bytes) of the item datatype |
host | The name or IP address of the receiving host; can be NULL, None, or "0.0.0.0" to allow reading from any interface on the host |
port | The port number on which to receive data; use 0 to have the system assign an unused port number |
payload_size | UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) |
eof | Interpret zero-length packet as EOF (default: true) |
wait | Wait for data if not immediately available (default: true) |
gr_udp_source::~gr_udp_source | ( | ) |
int gr_udp_source::get_port | ( | ) |
return the port number of the socket
int gr_udp_source::payload_size | ( | ) | [inline] |
return the PAYLOAD_SIZE of the socket
int gr_udp_source::work | ( | int | noutput_items, |
gr_vector_const_void_star & | input_items, | ||
gr_vector_void_star & | output_items | ||
) | [virtual] |
just like gr_block::general_work, only this arranges to call consume_each for you
The user must override work to define the signal processing code
Implements gr_sync_block.
gr_udp_source_sptr gr_make_udp_source | ( | size_t | itemsize, |
const char * | host, | ||
unsigned short | port, | ||
int | payload_size, | ||
bool | eof, | ||
bool | wait | ||
) | [friend] |