GNU Radio 3.7.1 C++ API
|
Read stream from an UDP socket. More...
#include <udp_source.h>
Public Types | |
typedef boost::shared_ptr < udp_source > | sptr |
Public Member Functions | |
virtual void | connect (const std::string &host, int port)=0 |
Change the connection to a new destination. | |
virtual void | disconnect ()=0 |
Cut the connection if we have one set up. | |
virtual int | payload_size ()=0 |
return the PAYLOAD_SIZE of the socket | |
virtual int | get_port ()=0 |
return the port number of the socket | |
Static Public Member Functions | |
static sptr | make (size_t itemsize, const std::string &host, int port, int payload_size=1472, bool eof=true) |
UDP Source Constructor. |
Read stream from an UDP socket.
virtual void gr::blocks::udp_source::connect | ( | const std::string & | host, |
int | port | ||
) | [pure virtual] |
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.
virtual void gr::blocks::udp_source::disconnect | ( | ) | [pure virtual] |
Cut the connection if we have one set up.
virtual int gr::blocks::udp_source::get_port | ( | ) | [pure virtual] |
return the port number of the socket
static sptr gr::blocks::udp_source::make | ( | size_t | itemsize, |
const std::string & | host, | ||
int | port, | ||
int | payload_size = 1472 , |
||
bool | eof = true |
||
) | [static] |
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) |
virtual int gr::blocks::udp_source::payload_size | ( | ) | [pure virtual] |
return the PAYLOAD_SIZE of the socket