gr_udp_sink Class Reference
[Signal Sinks]

Write stream to an UDP socket. More...

#include <gr_udp_sink.h>

Inheritance diagram for gr_udp_sink:

Inheritance graph
[legend]
Collaboration diagram for gr_udp_sink:

Collaboration graph
[legend]

List of all members.

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)


Detailed Description

Write stream to an UDP socket.

Parameters:
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))

Constructor & Destructor Documentation

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.

Parameters:
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 (  ) 


Member Function Documentation

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.


Friends And Related Function Documentation

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]


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

Generated on Thu Mar 5 09:03:13 2009 for GNU Radio 3.1.3 by  doxygen 1.5.8