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

MNSocketQueue Class Reference

#include <MNSocketQueue.h>

Collaboration diagram for MNSocketQueue:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MNSocketQueue ()
 ~MNSocketQueue ()
void send_bytes (MNRTPbase *caller, struct sockaddr_in *target)
void push_rtp_back (struct iovec *iov, int blocks)
void push_rtp_front (struct iovec *iov, int blocks)
void push_leftovers_rtp (struct iovec *iov, int blocks, int sent, int where=MNSocketQueue::BACK)
bool isEmpty ()
double getQueueSize ()

Protected Attributes

MNPCList< struct iovec * > _rtp_queue

Detailed Description

MNSocketQueue

Streaming RTP over TCP requires storing, retrieving and sending of data that is not yet sent due to full socket buffers. When one chunk of RTP data is sent to the TCP socket, a part of the chunk can be left unsent due to full socket buffers. The MNSocketQueue stores pointers to iovec structures not yet sent, and store them in the right order. When the socket is writable again, the MNSocketQueue us notified and tries to send from the front of the queue.


Constructor & Destructor Documentation

MNSocketQueue::MNSocketQueue  ) 
 

MNSocketQueue::~MNSocketQueue  ) 
 


Member Function Documentation

double MNSocketQueue::getQueueSize  ) 
 

bool MNSocketQueue::isEmpty  ) 
 

void MNSocketQueue::push_leftovers_rtp struct iovec *  iov,
int  blocks,
int  sent,
int  where = MNSocketQueue::BACK
 

The method takes a number of iovecs (indicated by blocks), and how many bytes of the iovecs that was sent. It cleans out already sent data and adds remaining iovecs by calling push_rtp_back for each remaining iovec.

Parameters:
iov A pointer to the iovec structure(s) that was tried sent
blocks Number of iovecs referred to from the pointer.
sent Number of bytes sent of the structure(s)
where The leftovers shall be stored first or last in the queue.

void MNSocketQueue::push_rtp_back struct iovec *  iov,
int  blocks
 

The method adds a struct iovec pointer at the end of the queue

Parameters:
iov A pointer to the iovec structure to be stored.
blocks The pointer can refer to an array of iovecs. Blocks indicates the size of the array. If it is not an array the parameter value equals 1.

void MNSocketQueue::push_rtp_front struct iovec *  iov,
int  blocks
 

The method adds a struct iovec pointer at the front of the queue

Parameters:
iov A pointer to the iovec structure to be stored.
blocks The pointer can refer to an array of iovecs. Blocks indicates the size of the array. If it is not an array the parameter value equals 1.

void MNSocketQueue::send_bytes MNRTPbase caller,
struct sockaddr_in *  target
 

The method is triggered by the MNSelector when the socket is in the write set. This indicates that the socket can be fed with more data. The method is also called manually by MNRTP::rtp_send if necessary.

Parameters:
caller The object that called this method.
target The socket destination target for sending data.


Member Data Documentation

MNPCList<struct iovec*> MNSocketQueue::_rtp_queue [protected]
 

The list (queue) stores pointers to struct iovecs


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