Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

T_RTPSocket Class Template Reference

Generic RTP protocol stack for exchange of realtime data. RTP protocol stack based on Common C++. More...

#include <cc++/rtp.h>

Inheritance diagram for T_RTPSocket::

serviceQueue List of all members.

Public Methods

 T_RTPSocket (const InetAddress &ia, tpport_t port=5004, int pri=0)
 T_RTPSocket (const InetMcastAddress &bind, tpport_t port=5004, int pri=0)
 ~T_RTPSocket ()
 Stack destructor. More...

sockerror_t Connect (const InetHostAddress &ia, tpport_t port=0)
 Connect to a foreign host and start the service thread. More...

sockerror_t Connect (const InetMcastAddress &ia, tpport_t port=0)
 Connect to a multicast group and start the service thread. More...

sockerror_t joinGroup (const InetMcastAddress &ia, tpport_t port=0)
 Join a multicast group. More...

sockerror_t leaveGroup (const InetMcastAddress &ia)
 Leave a multicast group. More...

sockerror_t setMcastTTL (uint8 ttl)
 Set the value of the TTL field in the sent packets. More...


Protected Methods

bool isPendingData (microtimeout_t timeout)
size_t readData (unsigned char *buffer, size_t len)
size_t writeData (const unsigned char *const buffer, size_t len)
bool isPendingControl (microtimeout_t timeout)
size_t readControl (unsigned char *buffer, size_t len)
size_t writeControl (const unsigned char *const buffer, size_t len)
void endSocket ()

Detailed Description

template<typename serviceQueue, typename dataSocket, typename controlSocket>
class T_RTPSocket< serviceQueue, dataSocket, controlSocket >

Generic RTP protocol stack for exchange of realtime data. RTP protocol stack based on Common C++.

This stack uses the concept of packet send and receive queues to schedule and buffer outgoing packets and to arrange or reorder incoming packets as they arrive. A single service thread both schedules sending of outgoing packets and receipt of incoming packets.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

template<typename serviceQueue, typename dataSocket, typename controlSocket>
T_RTPSocket< serviceQueue, dataSocket, controlSocket >::T_RTPSocket const InetAddress &   ia,
tpport_t   port = 5004,
int   pri = 0
[inline]
 

Parameters:
bind   network address this socket is to be bound
port   transport port this socket is to be bound
pri   service thread base priority relative to it's parent

template<typename serviceQueue, typename dataSocket, typename controlSocket>
T_RTPSocket< serviceQueue, dataSocket, controlSocket >::T_RTPSocket const InetMcastAddress &   bind,
tpport_t   port = 5004,
int   pri = 0
[inline]
 

Parameters:
bind   multicast network address this socket is to be bound
port   transport port this socket is to be bound
pri   service thread base priority relative to it's parent

template<typename serviceQueue, typename dataSocket, typename controlSocket>
T_RTPSocket< serviceQueue, dataSocket, controlSocket >::~T_RTPSocket   [inline]
 

Stack destructor.


Member Function Documentation

template<typename serviceQueue, typename dataSocket, typename controlSocket>
sockerror_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::Connect const InetMcastAddress &   ia,
tpport_t   port = 0
[inline]
 

Connect to a multicast group and start the service thread.

If no port is specified then it is assumed to be the same as the locally bound port number.

template<typename serviceQueue, typename dataSocket, typename controlSocket>
sockerror_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::Connect const InetHostAddress &   ia,
tpport_t   port = 0
[inline]
 

Connect to a foreign host and start the service thread.

If no port is specified then it is assumed to be the same as the locally bound port number.

template<typename serviceQueue, typename dataSocket, typename controlSocket>
void T_RTPSocket< serviceQueue, dataSocket, controlSocket >::endSocket   [inline, protected]
 

template<typename serviceQueue, typename dataSocket, typename controlSocket>
bool T_RTPSocket< serviceQueue, dataSocket, controlSocket >::isPendingControl microtimeout_t   timeout [inline, protected]
 

Parameters:
timeout   maximum timeout to wait, in microseconds
Returns:
whether there are packets waiting to be picked

template<typename serviceQueue, typename dataSocket, typename controlSocket>
bool T_RTPSocket< serviceQueue, dataSocket, controlSocket >::isPendingData microtimeout_t   timeout [inline, protected]
 

Parameters:
timeout   maximum timeout to wait, in microseconds

template<typename serviceQueue, typename dataSocket, typename controlSocket>
sockerror_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::joinGroup const InetMcastAddress &   ia,
tpport_t   port = 0
[inline]
 

Join a multicast group.

Parameters:
ia   address of the multicast group
Returns:
error code from the socket operation

template<typename serviceQueue, typename dataSocket, typename controlSocket>
sockerror_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::leaveGroup const InetMcastAddress &   ia [inline]
 

Leave a multicast group.

Parameters:
ia   address of the multicast group
Returns:
error code from the socket operation

template<typename serviceQueue, typename dataSocket, typename controlSocket>
size_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::readControl unsigned char *   buffer,
size_t   len
[inline, protected]
 

Returns:
number of octets actually read
Parameters:
buffer  
len  

template<typename serviceQueue, typename dataSocket, typename controlSocket>
size_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::readData unsigned char *   buffer,
size_t   len
[inline, protected]
 

Parameters:
buffer   memory region to read to
len   maximum number of octets to read

template<typename serviceQueue, typename dataSocket, typename controlSocket>
sockerror_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::setMcastTTL uint8   ttl [inline]
 

Set the value of the TTL field in the sent packets.

Parameters:
ttl   Time To Live
Returns:
error code from the socket operation

template<typename serviceQueue, typename dataSocket, typename controlSocket>
size_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::writeControl const unsigned char *const   buffer,
size_t   len
[inline, protected]
 

Returns:
number of octets actually written
Parameters:
buffer  
len  

template<typename serviceQueue, typename dataSocket, typename controlSocket>
size_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::writeData const unsigned char *const   buffer,
size_t   len
[inline, protected]
 

Parameters:
buffer   memory region to write from
len   number of octets to write


The documentation for this class was generated from the following file:
Generated at Sat Nov 3 09:44:14 2001 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001