#include <gr_udp_sink.h>
Public Member Functions | |
~gr_udp_sink () | |
bool | open () |
open a socket specified by the port and ip address info | |
void | close () |
Close current socket. | |
int | payload_size () |
return the PAYLOAD_SIZE 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_sink (size_t itemsize, const char *src, unsigned short port_src, const char *dst, unsigned short port_dst, int payload_size) | |
UDP Sink Constructor. | |
Friends | |
gr_udp_sink_sptr | gr_make_udp_sink (size_t itemsize, const char *src, unsigned short port_src, const char *dst, unsigned short port_dst, int payload_size) |
itemsize | The size (in bytes) of the item datatype | |
src | The source address as either the host name or the 'numbers-and-dots' IP address | |
port_src | Destination port to bind to (0 allows socket to choose an appropriate port) | |
dst | The destination address as either the host name or the 'numbers-and-dots' IP address | |
port_dst | Destination port to connect to | |
payload_size | UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) |
gr_udp_sink::gr_udp_sink | ( | size_t | itemsize, | |
const char * | src, | |||
unsigned short | port_src, | |||
const char * | dst, | |||
unsigned short | port_dst, | |||
int | payload_size | |||
) | [protected] |
UDP Sink Constructor.
itemsize | The size (in bytes) of the item datatype | |
src | The source address as either the host name or the 'numbers-and-dots' IP address | |
port_src | Destination port to bind to (0 allows socket to choose an appropriate port) | |
dst | The destination address as either the host name or the 'numbers-and-dots' IP address | |
port_dst | Destination port to connect to | |
payload_size | UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) |
gr_udp_sink::~gr_udp_sink | ( | ) |
void gr_udp_sink::close | ( | ) |
Close current socket.
Shuts down read/write on the socket
bool gr_udp_sink::open | ( | ) |
open a socket specified by the port and ip address info
Opens a socket, binds to the address, and makes connectionless association over UDP. If any of these fail, the fuction retuns the error and exits.
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_udp_sink_sptr gr_make_udp_sink | ( | size_t | itemsize, | |
const char * | src, | |||
unsigned short | port_src, | |||
const char * | dst, | |||
unsigned short | port_dst, | |||
int | payload_size | |||
) | [friend] |