gr_udp_source Class Reference
[Signal Sinks]

Read stream from an UDP socket. More...

#include <gr_udp_source.h>

Inheritance diagram for gr_udp_source:

Inheritance graph
[legend]
Collaboration diagram for gr_udp_source:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~gr_udp_source ()
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_source (size_t itemsize, const char *src, unsigned short port_src, int payload_size)
 UDP Source Constructor.

Friends

gr_udp_source_sptr gr_make_udp_source (size_t itemsize, const char *src, unsigned short port_src, int payload_size)


Detailed Description

Read stream from 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 The port number on which the socket listens for data
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_source::gr_udp_source ( size_t  itemsize,
const char *  src,
unsigned short  port_src,
int  payload_size 
) [protected]

UDP Source 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 The port number on which the socket listens for data
payload_size UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))

gr_udp_source::~gr_udp_source (  ) 


Member Function Documentation

void gr_udp_source::close (  ) 

Close current socket.

Shuts down read/write on the socket

bool gr_udp_source::open (  ) 

open a socket specified by the port and ip address info

Opens a socket, binds to the address, and waits for a connection over UDP. If any of these fail, the fuction retuns the error and exits.

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 *  src,
unsigned short  port_src,
int  payload_size 
) [friend]


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

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