torque Torque Game Engine Documentation
CVS Revision Label 1.3.x

ConnectionProtocol Class Reference

#include <dnet.h>

Inheritance diagram for ConnectionProtocol:

NetConnection GameConnection AIConnection AIClient

Detailed Description

The base class for Torque's networking protocol.

This implements a sliding window connected message stream over an unreliable transport (UDP). It provides a simple notify protocol to allow subclasses to be aware of what packets were sent succesfully and which failed.

Basically, a window size of 32 is provided, and each packet contains in the header a bitmask, acknowledging the receipt (or failure to receive) of the last 32 packets.

See also:
NetConnection, NetProtocol


Public Member Functions

 ConnectionProtocol ()
void buildSendPacketHeader (BitStream *bstream, S32 packetType=0)
void sendPingPacket ()
void sendAckPacket ()
void setConnectionEstablished ()
bool windowFull ()
bool connectionEstablished ()
void setConnectSequence (U32 connectSeq)
virtual void writeDemoStartBlock (ResizeBitStream *stream)
virtual bool readDemoStartBlock (BitStream *stream)
virtual void processRawPacket (BitStream *bstream)
virtual Net::Error sendPacket (BitStream *bstream)=0
virtual void keepAlive ()=0
virtual void handleConnectionEstablished ()=0
virtual void handleNotify (bool recvd)=0
virtual void handlePacket (BitStream *bstream)=0

Protected Attributes

U32 mLastSeqRecvdAtSend [32]
U32 mLastSeqRecvd
U32 mHighestAckedSeq
U32 mLastSendSeq
U32 mAckMask
U32 mConnectSequence
U32 mLastRecvAckAck
bool mConnectionEstablished


Constructor & Destructor Documentation

ConnectionProtocol::ConnectionProtocol  ) 
 


Member Function Documentation

void ConnectionProtocol::buildSendPacketHeader BitStream bstream,
S32  packetType = 0
 

void ConnectionProtocol::sendPingPacket  ) 
 

void ConnectionProtocol::sendAckPacket  ) 
 

void ConnectionProtocol::setConnectionEstablished  )  [inline]
 

bool ConnectionProtocol::windowFull  ) 
 

bool ConnectionProtocol::connectionEstablished  ) 
 

void ConnectionProtocol::setConnectSequence U32  connectSeq  )  [inline]
 

virtual void ConnectionProtocol::writeDemoStartBlock ResizeBitStream stream  )  [virtual]
 

Reimplemented in GameConnection, and NetConnection.

virtual bool ConnectionProtocol::readDemoStartBlock BitStream stream  )  [virtual]
 

Reimplemented in GameConnection, and NetConnection.

virtual void ConnectionProtocol::processRawPacket BitStream bstream  )  [virtual]
 

Reimplemented in NetConnection.

virtual Net::Error ConnectionProtocol::sendPacket BitStream bstream  )  [pure virtual]
 

Implemented in NetConnection.

virtual void ConnectionProtocol::keepAlive  )  [pure virtual]
 

Implemented in NetConnection.

virtual void ConnectionProtocol::handleConnectionEstablished  )  [pure virtual]
 

Implemented in NetConnection.

virtual void ConnectionProtocol::handleNotify bool  recvd  )  [pure virtual]
 

Implemented in NetConnection.

virtual void ConnectionProtocol::handlePacket BitStream bstream  )  [pure virtual]
 

Implemented in NetConnection.


Field Documentation

U32 ConnectionProtocol::mLastSeqRecvdAtSend[32] [protected]
 

U32 ConnectionProtocol::mLastSeqRecvd [protected]
 

U32 ConnectionProtocol::mHighestAckedSeq [protected]
 

U32 ConnectionProtocol::mLastSendSeq [protected]
 

U32 ConnectionProtocol::mAckMask [protected]
 

U32 ConnectionProtocol::mConnectSequence [protected]
 

Reimplemented in NetConnection.

U32 ConnectionProtocol::mLastRecvAckAck [protected]
 

bool ConnectionProtocol::mConnectionEstablished [protected]
 




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen