Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

RTPSockets Struct Reference

#include <MNRTPSockets.h>

Collaboration diagram for RTPSockets:

Collaboration graph
[legend]
List of all members.

Public Types

typedef u_int32_t FactoryMode
 a caller role

Public Member Functions

 RTPSockets ()
 RTPSockets (MNSelector *sel)
 RTPSockets (const RTPSockets *orig)
 RTPSockets (MNSocket *rtp, MNSocket *rtcp)
RTPSocketsoperator= (const RTPSockets *orig)
bool isSet () const
int port () const

Static Public Member Functions

RTPSocketsfactory (int &port, int limit, FactoryMode m=RTPSockets::DEFAULT)
bool factory (RTPSockets *pair, int &port, int limit, FactoryMode m=RTPSockets::DEFAULT)

Public Attributes

u_int32_t caller_role
RTSP::TransportTypes transport_protocol
MNSocketrtp
MNSocketrtcp
MNString client_hostname

Static Public Attributes

const u_int32_t DEFAULT = 0
const u_int32_t RTCP_FAIL_OK = 1
 a factory mode
const u_int32_t FIXED_PORT = 2
 a factory mode
const u_int32_t SERVER = 0
 a factory mode
const u_int32_t CLIENT = 1
 a caller role

Detailed Description

RTPSockets

RTP and RTCP sockets are nearly always created in pairs. To make interchange of sockets rather than (the useless and dangerous) port numbers easier, this struct is introduced to create and transport pairs of RTP and RTCP sockets.


Member Typedef Documentation

typedef u_int32_t RTPSockets::FactoryMode
 

a caller role


Constructor & Destructor Documentation

RTPSockets::RTPSockets  ) 
 

RTPSockets::RTPSockets MNSelector sel  ) 
 

RTPSockets::RTPSockets const RTPSockets orig  ) 
 

RTPSockets::RTPSockets MNSocket rtp,
MNSocket rtcp
 


Member Function Documentation

bool RTPSockets::factory RTPSockets pair,
int &  port,
int  limit,
FactoryMode  m = RTPSockets::DEFAULT
[static]
 

This factory call initializes a local variable with opened UDPClientSockets/TCPClientSockets. Typically, it binds one to an even and one to an odd socket for RTP and RTCP and fails if that is not possible. If the factory mode m indicates that RTCP is allowed to fail, only an even socket may be opened.

Parameters:
pair A referenced to a clean RTPSockets struct that should not refer to any sockets yet. The condition is not verified, which may result in memory leaks and forgotten file descriptors-
port The lowest permissible port to open. If an exact port assignment is required, the only permissible port to open. In case of success, this variable contains the RTP port that has been opened. In case of failure this variable is undefined after the call.
limit The highest RTP port number that might be chosen. In case of fixed RTP port request, this is ignored.
m The creation mode. Flags are described above.
Returns:
true if the UDP/TCP sockets are opened successfully, or in case that RTCP is allowed to fail, true is also returned if only RTP has been opened. false if something went wrong.

RTPSockets* RTPSockets::factory int &  port,
int  limit,
FactoryMode  m = RTPSockets::DEFAULT
[static]
 

bool RTPSockets::isSet  )  const [inline]
 

RTPSockets& RTPSockets::operator= const RTPSockets orig  ) 
 

int RTPSockets::port  )  const [inline]
 


Member Data Documentation

u_int32_t RTPSockets::caller_role
 

const u_int32_t RTPSockets::CLIENT = 1 [static]
 

a caller role

MNString RTPSockets::client_hostname
 

const u_int32_t RTPSockets::DEFAULT = 0 [static]
 

const u_int32_t RTPSockets::FIXED_PORT = 2 [static]
 

a factory mode

MNSocket* RTPSockets::rtcp
 

const u_int32_t RTPSockets::RTCP_FAIL_OK = 1 [static]
 

a factory mode

MNSocket* RTPSockets::rtp
 

const u_int32_t RTPSockets::SERVER = 0 [static]
 

a factory mode

RTSP::TransportTypes RTPSockets::transport_protocol
 


The documentation for this struct was generated from the following file:
Generated on Sun Mar 6 13:36:10 2005 for Komssys by doxygen 1.3.8