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

TNL::EventConnection Class Reference

EventConnection is a NetConnection subclass used for sending guaranteed and unguaranteed event packages across a connection. More...

#include <tnlEventConnection.h>

Inheritance diagram for TNL::EventConnection:

TNL::NetConnection TNL::Object TNL::GhostConnection List of all members.

Public Methods

U32 getEventClassVersion ()
 returns the highest event version number supported on this connection.

bool postNetEvent (NetEvent *event)
 Posts a NetEvent for processing on the remote host.


Protected Methods

PacketNotify * allocNotify ()
 Allocates a PacketNotify for this connection.

void packetDropped (PacketNotify *notify)
 Override processing to requeue any guaranteed events in the packet that was dropped.

void packetReceived (PacketNotify *notify)
 Override processing to notify for delivery and dereference any events sent in the packet.

void writePacket (BitStream *bstream, PacketNotify *notify)
 Writes pending events into the packet, and attaches them to the PacketNotify.

void readPacket (BitStream *bstream)
 Reads events from the stream, and queues them for processing.

virtual bool isDataToTransmit ()
 Returns true if there are events pending that should be sent across the wire.

void processEvent (NetEvent *theEvent)
 Dispatches an event.

void writeConnectRequest (BitStream *stream)
 Writes the NetEvent class count into the stream, so that the remote host can negotiate a class count for the connection.

bool readConnectRequest (BitStream *stream, const char **errorString)
 Reads the NetEvent class count max that the remote host is requesting.

void writeConnectAccept (BitStream *stream)
 Writes the negotiated NetEvent class count into the stream.

bool readConnectAccept (BitStream *stream, const char **errorString)
 Reads the negotiated NetEvent class count from the stream and validates that it is on a boundary between versions.


Protected Attributes

U32 mEventClassCount
 Number of NetEvent classes supported by this connection.

U32 mEventClassBitSize
 Bit field width of NetEvent class count.

U32 mEventClassVersion
 The highest version number of events on this connection.


Detailed Description

EventConnection is a NetConnection subclass used for sending guaranteed and unguaranteed event packages across a connection.

The EventConnection is responsible for transmitting NetEvents over the wire. It deals with ensuring that the various types of NetEvents are delivered appropriately, and with notifying the event of its delivery status.

The EventConnection is mainly accessed via postNetEvent(), which accepts NetEvents.

See also:
NetEvent for a more thorough explanation of how to use events.

Definition at line 59 of file tnlEventConnection.h.


Member Function Documentation

bool TNL::EventConnection::readConnectRequest BitStream   stream,
const char **    errorString
[protected, virtual]
 

Reads the NetEvent class count max that the remote host is requesting.

If this host has MORE NetEvent classes declared, the mEventClassCount is set to the requested count, and is verified to lie on a boundary between versions.

Reimplemented from TNL::NetConnection.

Definition at line 90 of file eventConnection.cpp.

References TNL::NetConnection::getNetClassGroup(), TNL::getNextBinLog2(), mEventClassBitSize, mEventClassCount, mEventClassVersion, TNL::NetClassTypeEvent, TNL::BitStream::read(), and TNL::U32.


The documentation for this class was generated from the following files:
Generated on Thu Aug 18 16:03:37 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18