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

T_RTPSocket Class Template Reference

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 ()
sockerror_t Connect (const InetHostAddress &ia, tpport_t port=0)
sockerror_t Connect (const InetMcastAddress &ia, tpport_t port=0)
sockerror_t joinGroup (const InetMcastAddress &ia, tpport_t port=0)
sockerror_t leaveGroup (const InetMcastAddress &ia)
sockerror_t setMcastTTL (uint8 ttl)

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

Private Methods

sockerror_t connect (const InetAddress &ia, tpport_t port=0)
tpport_t odd_port (tpport_t port)
tpport_t even_port (tpport_t port)

Private Attributes

tpport_t base
dataSocket * dso
controlSocket * cso

Detailed Description

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

RTP protocol stack based on Common C++.

Generic RTP protocol stack for exchange of realtime data. 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>
Examples:

audiorx.cpp, audiotx.cpp, and rtphello.cpp.

Definition at line 2147 of file rtp.h.


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

Definition at line 2155 of file rtp.h.

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

Definition at line 2168 of file rtp.h.

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

Stack destructor.

Definition at line 2178 of file rtp.h.


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.

Definition at line 2196 of file rtp.h.

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.

Examples:
audiorx.cpp, audiotx.cpp, and rtphello.cpp.

Definition at line 2187 of file rtp.h.

Referenced by joinGroup().

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

Connect to a foriegn RTP socket and start the service thread. If no port is specified then it is assumed to be the same as the locally bound port number.

Returns:
failure type.
Parameters:
address   of foreign socket.
port   number of foreign connection.

Definition at line 2325 of file rtp.h.

Referenced by Connect().

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

Definition at line 2312 of file rtp.h.

Referenced by ~T_RTPSocket().

template<typename serviceQueue, typename dataSocket, typename controlSocket>
tpport_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::even_port tpport_t   port [inline, private]
 

Ensure a port number is even. If it is an odd number, return the next lower (even) port number.

Parameters:
port   number to filter
Returns:
filtered (even) port number

Definition at line 2364 of file rtp.h.

Referenced by T_RTPSocket(), and connect().

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

Definition at line 2290 of file rtp.h.

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

Definition at line 2266 of file rtp.h.

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

Definition at line 2206 of file rtp.h.

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

Definition at line 2232 of file rtp.h.

template<typename serviceQueue, typename dataSocket, typename controlSocket>
tpport_t T_RTPSocket< serviceQueue, dataSocket, controlSocket >::odd_port tpport_t   port [inline, private]
 

Ensure a port number is odd. If it is an even number, return the next lower (odd) port number.

Parameters:
port   number to filter
Returns:
filtered (odd) port number

Definition at line 2353 of file rtp.h.

Referenced by T_RTPSocket(), and connect().

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  

Definition at line 2299 of file rtp.h.

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

Definition at line 2274 of file rtp.h.

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

Definition at line 2250 of file rtp.h.

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  

Definition at line 2308 of file rtp.h.

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

Definition at line 2282 of file rtp.h.


Member Data Documentation

template<typename serviceQueue, typename dataSocket, typename controlSocket>
tpport_t T_RTPSocket::base [private]
 

Definition at line 2367 of file rtp.h.

template<typename serviceQueue, typename dataSocket, typename controlSocket>
controlSocket* T_RTPSocket::cso [private]
 

Definition at line 2369 of file rtp.h.

template<typename serviceQueue, typename dataSocket, typename controlSocket>
dataSocket* T_RTPSocket::dso [private]
 

Definition at line 2368 of file rtp.h.


The documentation for this class was generated from the following file:
Generated at Tue Oct 16 11:17:53 2001 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001