GNU Radio 3.7.1 C++ API
gr::blocks::udp_source Class Reference

Read stream from an UDP socket. More...

#include <udp_source.h>

Inheritance diagram for gr::blocks::udp_source:

List of all members.

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.

Detailed Description

Read stream from an UDP socket.


Member Typedef Documentation


Member Function Documentation

virtual void gr::blocks::udp_source::connect ( const std::string &  host,
int  port 
) [pure virtual]

Change the connection to a new destination.

Parameters:
hostThe name or IP address of the receiving host; use NULL or None to break the connection without closing
portDestination 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.

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)
virtual int gr::blocks::udp_source::payload_size ( ) [pure virtual]

return the PAYLOAD_SIZE of the socket


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