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

DatagramSocket Class Reference

#include <DatagramSocket.h>

Inheritance diagram for DatagramSocket:

Inheritance graph
[legend]
Collaboration diagram for DatagramSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DatagramSocket (RefCountedSocketFactory *factory, MNSelector &sel, MNSocket &sock)
 DatagramSocket (RefCountedSocketFactory *factory, MNSelector &sel, int port)
virtual ~DatagramSocket ()
virtual void activate (bool sender)
virtual void tcp_callback (MNSelector *select, int fd)
virtual void write_enabled ()
iovec * set_buffers_tcp (int &iovlen, int &buffersize)
void buffers_to_rope_tcp (struct iovec *iov, int &iovlen, size_t bytesused)

Public Attributes

MNSocketBaseT< DatagramSocket_callmeplease
MNSocketBaseT< DatagramSocket_callmepleasewrite

Detailed Description

DatagramSocket

The DatagramSocket class is used for streaming over TCP. When a tcp rtp-socket receives data, the MNSelector will via MNSocketBase call the funtion "tcp_callback" in this class instead of the regular "callback" function. This class will take care of reading from tcp-buffers so that we "fake" a datagram receive. The tcp_callback will first read 5 bytes containing the size of the upcoming rtp-packet. It then reads this size from the tcp-buffer and calls the reader() function.


Constructor & Destructor Documentation

DatagramSocket::DatagramSocket RefCountedSocketFactory factory,
MNSelector sel,
MNSocket sock
 

DatagramSocket::DatagramSocket RefCountedSocketFactory factory,
MNSelector sel,
int  port
 

virtual DatagramSocket::~DatagramSocket  )  [virtual]
 


Member Function Documentation

virtual void DatagramSocket::activate bool  sender  )  [virtual]
 

void DatagramSocket::buffers_to_rope_tcp struct iovec *  iov,
int &  iovlen,
size_t  bytesused
 

The function will not create a new rope and add leafs to it. Instead the rope is created as a member variabel and we add leafs to it until the recvmsg(s) has received the whole tcp-packet. After the packet is totally received, reader() is called and a new MNRope is againg created.

struct iovec* DatagramSocket::set_buffers_tcp int &  iovlen,
int &  buffersize
 

The function will create a simple iovec buffer, where the size comes from the first 5 bytes read on the socket.

virtual void DatagramSocket::tcp_callback MNSelector select,
int  fd
[virtual]
 

The specialized tcp-callback function which is called when the selector notices new incoming data on the tcp socket.

virtual void DatagramSocket::write_enabled  )  [virtual]
 

The function is called when the selector notices that the send buffer is not full anymore On lines with heavy traffic TCP may not be able to send as much data as wanted. In such cases the TCP socket runs full, and we will have to store not sent RTP data on an application queue. When the write_enabled function is called, the application can try to send more rtp data to the socket.

Reimplemented from MNSocketBase.


Member Data Documentation

MNSocketBaseT<DatagramSocket> DatagramSocket::_callmeplease
 

MNSocketBaseT<DatagramSocket> DatagramSocket::_callmepleasewrite
 


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