GNU Radio 3.6.5 C++ API
|
Write stream to an UDP socket. More...
#include <gr_udp_sink.h>
Public Member Functions | |
~gr_udp_sink () | |
int | payload_size () |
return the PAYLOAD_SIZE of the socket | |
void | connect (const char *host, unsigned short port) |
Change the connection to a new destination. | |
void | disconnect () |
Send zero-length packet (if eof is requested) then stop sending. | |
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_sink (size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof) | |
UDP Sink Constructor. | |
Friends | |
GR_CORE_API gr_udp_sink_sptr | gr_make_udp_sink (size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof) |
Write stream to an UDP socket.
itemsize | The size (in bytes) of the item datatype |
host | The name or IP address of the receiving host; use NULL or None for no connection |
port | Destination port to connect to on receiving host |
payload_size | UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) |
eof | Send zero-length packet on disconnect |
gr_udp_sink::gr_udp_sink | ( | size_t | itemsize, |
const char * | host, | ||
unsigned short | port, | ||
int | payload_size, | ||
bool | eof | ||
) | [protected] |
UDP Sink Constructor.
itemsize | The size (in bytes) of the item datatype |
host | The name or IP address of the receiving host; use NULL or None for no connection |
port | Destination port to connect to on receiving host |
payload_size | UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) |
eof | Send zero-length packet on disconnect |
gr_udp_sink::~gr_udp_sink | ( | ) |
void gr_udp_sink::connect | ( | const char * | host, |
unsigned short | port | ||
) |
Change the connection to a new destination.
host | The name or IP address of the receiving host; use NULL or None to break the connection without closing |
port | Destination port to connect to on receiving host |
Calls disconnect() to terminate any current connection first.
void gr_udp_sink::disconnect | ( | ) |
Send zero-length packet (if eof is requested) then stop sending.
Zero-byte packets can be interpreted as EOF by gr_udp_source. Note that disconnect occurs automatically when the sink is destroyed, but not when its top_block stops.
int gr_udp_sink::payload_size | ( | ) | [inline] |
return the PAYLOAD_SIZE of the socket
int gr_udp_sink::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_CORE_API gr_udp_sink_sptr gr_make_udp_sink | ( | size_t | itemsize, |
const char * | host, | ||
unsigned short | port, | ||
int | payload_size, | ||
bool | eof | ||
) | [friend] |