framexmit::frameRecv Class Reference
[Frame multicast client/server]

#include <framerecv.hh>

List of all members.

Public Member Functions

 frameRecv (int QoS=1)
 ~frameRecv ()
bool open (const char *mcast_addr, const char *interface=0, int port=frameXmitPort)
bool open (int port=frameXmitPort)
void close ()
bool purge ()
int receive (char *&data, int maxlen, unsigned int *sequence=0, unsigned int *timestamp=0, unsigned int *duration=0)
const char * logmsg ()
void clearlog ()
void logging (bool set=true)
void setmaxlog (int max=25)


Detailed Description

Class for receiving frame broadcast data. This class implements the broadcast receiver. A code example can be found in 'rcvtest.cc'.

brief Class for receiving frame broadcast data

Author:
Written August 1999 by Daniel Sigg
Version:
2.0

Constructor & Destructor Documentation

framexmit::frameRecv::frameRecv ( int  QoS = 1  )  [inline, explicit]

Constructs a broadcast receiver. An optional parameter specifies the quality of service: 0 - up to 30% retransmission; 1 - 10% retransmission; 2 - 3% retransmission. The QoS limit is determined by averaging over the retransmission of the last few data buffers. This allows for higher burst retransmission, but enforces a limit of the averaged retransmission.

Parameters:
QoS quality of service brief Default constructor.
Returns:
void

framexmit::frameRecv::~frameRecv (  )  [inline]

Destructs the broadcast receiver. brief Destructor.

Returns:
void


Member Function Documentation

bool framexmit::frameRecv::open ( const char *  mcast_addr,
const char *  interface = 0,
int  port = frameXmitPort 
)

Opens the conenction to the transmitter. If no multicast address is supplied, the function will listen to UDP/IP broadcast transmission at the specified port. Otherwise, it tries to join the specified multicast group at the given interface. If the interface is obmitted, the default interface will be used. In general, one can use the subnet address as the interface address argument. The function will then go through the list of all local interfaces and determine the closest match.

brief Open function.

Parameters:
mcast_addr multicast address
interface interface or subnet used by multicast
port port number to listen
Returns:
true if successful

bool framexmit::frameRecv::open ( int  port = frameXmitPort  )  [inline]

Opens the conenction to the transmitter. Uses UDP/IP broadcast. brief Open function.

Parameters:
port port number
Returns:
true if successful

void framexmit::frameRecv::close (  ) 

Closes the conenction. brief Close function.

Returns:
void

bool framexmit::frameRecv::purge (  ) 

Purges the receiver. This function will empty the receiver socket buffer and put the data into an internal buffer. Returns true if there is data in the internal buffer. This function only checks if at least one packet was received. There is no guarantee that a full data buffer was received. brief Purge function.

Returns:
true if data pending

int framexmit::frameRecv::receive ( char *&  data,
int  maxlen,
unsigned int *  sequence = 0,
unsigned int *  timestamp = 0,
unsigned int *  duration = 0 
)

Gets a data buffer. If the supplied data buffer is 0, the function allocates a new memory buffer upon return. Upon success the function returns the length of the received data. A value between -10 and -1 indicates a connection or memory allocation error, whereas a value below <10 indicates that the preallocated memory buffer is too small. In this case the negative of the needed length is returned.

brief receive function.

Parameters:
data data array
maxlen maximum length of data array (in bytes)
sequence sender sequence number (return)
timestamp time stamp of data array (return)
duration time length of data array (return)
Returns:
length of received data, if successful; <0 if failed

const char* framexmit::frameRecv::logmsg (  ) 

Last few log messages. brief log message function.

Returns:
log messages

void framexmit::frameRecv::clearlog (  ) 

Clear old log messages. brief clear log function.

Returns:

void framexmit::frameRecv::logging ( bool  set = true  )  [inline]

Turn logging on/off. brief turn log on function.

Parameters:
set true = on

void framexmit::frameRecv::setmaxlog ( int  max = 25  )  [inline]

Set maximum number of log messages. brief Maximum log messages function.

Parameters:
max Maximum messages


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:22 2009 for dmt by  doxygen 1.5.4