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

Write stream to an UDP socket. More...

#include <udp_sink.h>

Inheritance diagram for gr::blocks::udp_sink:

List of all members.

Public Types

typedef boost::shared_ptr
< udp_sink
sptr

Public Member Functions

virtual int payload_size ()=0
 return the PAYLOAD_SIZE of the socket
virtual void connect (const std::string &host, int port)=0
 Change the connection to a new destination.
virtual void disconnect ()=0
 Send zero-length packet (if eof is requested) then stop sending.

Static Public Member Functions

static sptr make (size_t itemsize, const std::string &host, int port, int payload_size=1472, bool eof=true)
 UDP Sink Constructor.

Detailed Description

Write stream to an UDP socket.


Member Typedef Documentation


Member Function Documentation

virtual void gr::blocks::udp_sink::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_sink::disconnect ( ) [pure virtual]

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.

static sptr gr::blocks::udp_sink::make ( size_t  itemsize,
const std::string &  host,
int  port,
int  payload_size = 1472,
bool  eof = true 
) [static]

UDP Sink Constructor.

Parameters:
itemsizeThe size (in bytes) of the item datatype
hostThe name or IP address of the receiving host; use NULL or None for no connection
portDestination port to connect to on receiving host
payload_sizeUDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
eofSend zero-length packet on disconnect
virtual int gr::blocks::udp_sink::payload_size ( ) [pure virtual]

return the PAYLOAD_SIZE of the socket


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