namespace diag class frameSend Class for broadcasting frame data
| | frameSend (int maxBuffers = sndDefaultBuffers) Default constructor. |
| | frameSend (const char* addr, const char* interface = 0, int port = frameXmitPort, int maxBuffers = sndDefaultBuffers) Constructor. |
| | ~frameSend () Destructor. |
| | open (const char* addr, const char* interface = 0, int port = frameXmitPort) Open function. |
| | open (int port = frameXmitPort) Open function. |
| | close () Close function. |
| | send (char* data, int len, bool* inUse = 0, bool copy = false, unsigned int timestamp = 0, unsigned int duration = 0) Send function. |
| | skipped () const Skip function. |
| | isUsed (bool& inUse) const isUsed function. |
Class for broadcasting frame data. This class implements the broadcast transmitter. A code example can be found in 'sndtest.cc'.
The send fucntion works as follows: 1. The send function will NOT transmit the buffer by itself
but rather put the buffer into a queue which is then managed
by the xmitdaemon. 2. The send function will always return immediately and will
NOT block until the buffer is sent. 3. If the buffer queue is full, the send function will remove
all unsent buffers from it. 4. After a buffer is sent, it will stay in the queue for an
additional time period (~3 sec) to allow retransmit. Then it
will automatically be released. 5. There are basically two ways to deal with the problem of
how long data in a buffer must be kept: a. The send function copies the buffer (avoids buffer validity
problems all together), or b. The send function does not copy the buffer and the caller
must keep the buffer valid until the xmitdaemon is done with it. In the second case the caller MUST NOT delete or change the
data in the buffer until it is no longer needed. To verify if
the buffer is still in use, the caller can check the 'inUse'
variable with th ehelp of the isUsed method.
explicit frameSend(const char* addr, const char* interface = 0, int port = frameXmitPort, int maxBuffers = sndDefaultBuffers)
interface - interface or subnet used by multicast
port - port number
maxBuffers - maximum number of used buffers
~frameSend()
bool open(const char* addr, const char* interface = 0, int port = frameXmitPort)
interface - interface or subnet used by multicast
port - port number
bool open(int port = frameXmitPort)
void close()
bool send(char* data, int len, bool* inUse = 0, bool copy = false, unsigned int timestamp = 0, unsigned int duration = 0)
len - length of data array (in bytes)
inUse - pointer to in use variable (ignored if 0)
copy - request a copy of the data to be used
timestamp - time stamp of data array
duration - time length of data array
int skipped() const
bool isUsed(bool& inUse) const
buffer()
buffer(const buffer& buf)
buffer(char* Data, int Len, unsigned int Seq, bool Own = false, bool* Used = 0, mutex* InUseMux = 0, unsigned int Timestamp = 0, unsigned int Duration = 0)
~buffer()
buffer& operator= (const buffer& buf)
unsigned int seq
mutable bool own
char* data
int len
mutable bool* used
mutex* inUseMux
alphabetic index hierarchy of classes
Please send questions and comments to sigg_d@ligo-wa.caltech.edu
generated by doc++