GNU Radio 3.3.0 C++ API
gr_udp_source Class Reference

Read stream from an UDP socket. More...

#include <gr_udp_source.h>

Inheritance diagram for gr_udp_source:

List of all members.

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)

Detailed Description

Read stream from an UDP socket.

Parameters:
itemsizeThe size (in bytes) of the item datatype
hostThe 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
portThe port number on which to receive data; use 0 to have the system assign an unused port number
payload_sizeUDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
eofInterpret zero-length packet as EOF (default: true)
waitWait for data if not immediately available (default: true)

Constructor & Destructor Documentation

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.

Parameters:
itemsizeThe size (in bytes) of the item datatype
hostThe 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
portThe port number on which to receive data; use 0 to have the system assign an unused port number
payload_sizeUDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
eofInterpret zero-length packet as EOF (default: true)
waitWait for data if not immediately available (default: true)
gr_udp_source::~gr_udp_source ( )

Member Function Documentation

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.


Friends And Related Function Documentation

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]

The documentation for this class was generated from the following file: