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

TransportLayer Class Reference

This is basically a wrapper around the ServiceTable. More...

#include <TransportLayer.h>

List of all members.

Public Methods

 TransportLayer ()
 Create the Transport Layer. More...

 ~TransportLayer ()
int connect ()
 Return a identifier for a connection that can be used later to read or disconnect. More...

int listenAccept ()
 Return a identifier for a connection that can be used later to read or disconnect. More...

int send (int serviceNumber, u_char *msg, int length)
 Send data to the connection descriptor. More...

int receive (int serviceNumber, u_char *msg, int length)
 Receive data on the connection description specified. More...

bool disconnect (int serviceNumber)
 Disconnect from the connection descriptor specified. More...

ServiceTablegetServiceTable ()
NetworkLayergetNetworkLayer ()

Private Attributes

ServiceTablem_serviceTable


Detailed Description

This is basically a wrapper around the ServiceTable.

The call structure:

->Create TransportLayer
  |->Create Timer
  |->Create ServiceTable
     |->Create NetworkLayer
     |  |->Create LinkLayerInterface
     |  |  |->Create connection table
     |  |  |->start thread: listen
     |  |  |->start thread: peerConnect
     |  |  |->start thread: receivePacket
     |  |->register as packet handler for LLI
     |  |->Create VirtualCircuitTable
     |  |->Create PriorityPacketQueue
     |  |->Create LiveBroadcastTable
     |  |  |->start thread:onTick 
     |  |->start thread:processPackets

Definition at line 7 of file TransportLayer.h.


Constructor & Destructor Documentation

TransportLayer::TransportLayer
 

Create the Transport Layer.

Definition at line 45 of file TransportLayer.cpp.

TransportLayer::~TransportLayer
 

Definition at line 54 of file TransportLayer.cpp.


Member Function Documentation

int TransportLayer::connect
 

Return a identifier for a connection that can be used later to read or disconnect.

Definition at line 65 of file TransportLayer.cpp.

Referenced by ProxyRequestCommand::run().

bool TransportLayer::disconnect int serviceNumber
 

Disconnect from the connection descriptor specified.

This function MUST be called to destroy any connection you create, or any connection that has been accepted. Otherwise you will have a memory leak.

Returns:
true if successful, false if the service number does not exist.

Definition at line 132 of file TransportLayer.cpp.

Referenced by WebServer::handleConnection(), and ProxyRequestCommand::run().

NetworkLayer * TransportLayer::getNetworkLayer
 

Definition at line 145 of file TransportLayer.cpp.

Referenced by GlobalObjects::init().

ServiceTable * TransportLayer::getServiceTable
 

Definition at line 139 of file TransportLayer.cpp.

Referenced by GlobalObjects::getServiceTable().

int TransportLayer::listenAccept
 

Return a identifier for a connection that can be used later to read or disconnect.

Definition at line 76 of file TransportLayer.cpp.

Referenced by WebServer::run().

int TransportLayer::receive int serviceNumber,
u_char * msg,
int length
 

Receive data on the connection description specified.

Parameters:
connection_descriptor   Read data from this logical connection.
msg   A buffer to put the data into.
length   The size of the buffer.
Returns:
the amount of data read.

Definition at line 112 of file TransportLayer.cpp.

Referenced by WebServer::handleConnection(), and ProxyRequestCommand::run().

int TransportLayer::send int serviceNumber,
u_char * msg,
int length
 

Send data to the connection descriptor.

Returns:
PB_OK if successful, PB_UNREACHABLE if not

Definition at line 89 of file TransportLayer.cpp.

Referenced by WebServer::handleConnection(), and ProxyRequestCommand::run().


Member Data Documentation

ServiceTable* TransportLayer::m_serviceTable [private]
 

Definition at line 27 of file TransportLayer.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:32:00 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001