#include <tnlEventConnection.h>
Inheritance diagram for TNL::EventConnection:
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.
Public Member Functions | |
EventConnection () | |
~EventConnection () | |
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 Types | |
enum | DebugConstants { DebugChecksum = 0xF00DBAAD, BitStreamPosBitSize = 16 } |
Protected Member Functions | |
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. | |
Private Types | |
typedef NetConnection | Parent |
enum | { InvalidSendEventSeq = -1, FirstValidSendEventSeq = 0 } |
Private Attributes | |
EventNote * | mSendEventQueueHead |
Head of the list of events to be sent to the remote host. | |
EventNote * | mSendEventQueueTail |
Tail of the list of events to be sent to the remote host. New events are tagged on to the end of this list. | |
EventNote * | mUnorderedSendEventQueueHead |
Head of the list of events sent without ordering information. | |
EventNote * | mUnorderedSendEventQueueTail |
Tail of the list of events sent without ordering information. | |
EventNote * | mWaitSeqEvents |
List of ordered events on the receiving host that are waiting on previous sequenced events to arrive. | |
EventNote * | mNotifyEventList |
Ordered list of events on the sending host that are waiting for receipt of processing on the client. | |
S32 | mNextSendEventSeq |
The next sequence number for an ordered event sent through this connection. | |
S32 | mNextRecvEventSeq |
The next receive event sequence to process. | |
S32 | mLastAckedEventSeq |
The last event the remote host is known to have processed. | |
Static Private Attributes | |
ClassChunker< EventNote > | mEventNoteChunker |
Quick memory allocator for net event notes. |
|
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection, and TNLTest::TestConnection. |
|
|
|
|
|
|
|
|
|
Allocates a PacketNotify for this connection.
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection. |
|
Override processing to requeue any guaranteed events in the packet that was dropped.
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection. |
|
Override processing to notify for delivery and dereference any events sent in the packet.
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection. |
|
Writes pending events into the packet, and attaches them to the PacketNotify.
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection. |
|
Reads events from the stream, and queues them for processing.
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection. |
|
Returns true if there are events pending that should be sent across the wire.
Reimplemented from TNL::NetConnection. Reimplemented in TNL::GhostConnection, and TNLTest::TestConnection. |
|
Dispatches an event.
|
|
Writes the NetEvent class count into the stream, so that the remote host can negotiate a class count for the connection.
Reimplemented from TNL::NetConnection. |
|
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. |
|
Writes the negotiated NetEvent class count into the stream.
Reimplemented from TNL::NetConnection. |
|
Reads the negotiated NetEvent class count from the stream and validates that it is on a boundary between versions.
Reimplemented from TNL::NetConnection. |
|
returns the highest event version number supported on this connection.
|
|
Posts a NetEvent for processing on the remote host.
|
|
Quick memory allocator for net event notes.
|
|
Head of the list of events to be sent to the remote host.
|
|
Tail of the list of events to be sent to the remote host. New events are tagged on to the end of this list.
|
|
Head of the list of events sent without ordering information.
|
|
Tail of the list of events sent without ordering information.
|
|
List of ordered events on the receiving host that are waiting on previous sequenced events to arrive.
|
|
Ordered list of events on the sending host that are waiting for receipt of processing on the client.
|
|
The next sequence number for an ordered event sent through this connection.
|
|
The next receive event sequence to process.
|
|
The last event the remote host is known to have processed.
|
|
Number of NetEvent classes supported by this connection.
|
|
Bit field width of NetEvent class count.
|
|
The highest version number of events on this connection.
|