Public Member Functions | Protected Member Functions | Protected Attributes

PacketizedTCP Class Reference

#include <PacketizedTCP.h>

Inherits TCPInterface.

Collaboration diagram for PacketizedTCP:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PacketizedTCP ()
virtual ~PacketizedTCP ()
bool Start (unsigned short port, unsigned short maxIncomingConnections, int threadPriority=-99999)
void Stop (void)
 Stops the TCP server.
void Send (const char *data, unsigned length, SystemAddress systemAddress, bool broadcast)
 Sends a byte stream.
bool SendList (const char **data, const int *lengths, const int numParameters, SystemAddress systemAddress, bool broadcast)
PacketReceive (void)
 Returns data received.
void CloseConnection (SystemAddress systemAddress)
 Disconnects a player/address.
SystemAddress HasCompletedConnectionAttempt (void)
SystemAddress HasFailedConnectionAttempt (void)
SystemAddress HasNewIncomingConnection (void)
 Queued events of new incoming connections.
SystemAddress HasLostConnection (void)
 Queued events of lost connections.
void AttachPlugin (PluginInterface2 *plugin)
void DetachPlugin (PluginInterface2 *plugin)

Protected Member Functions

void ClearAllConnections (void)
void RemoveFromConnectionList (SystemAddress sa)
void AddToConnectionList (SystemAddress sa)
void PushNotificationsToQueues (void)
PacketReturnOutgoingPacket (void)

Protected Attributes

DataStructures::List
< PluginInterface2 * > 
messageHandlerList
DataStructures::Queue< Packet * > waitingPackets
DataStructures::Map
< SystemAddress,
DataStructures::ByteQueue * > 
connections
DataStructures::Queue
< SystemAddress
_newIncomingConnections
DataStructures::Queue
< SystemAddress
_lostConnections
DataStructures::Queue
< SystemAddress
_failedConnectionAttempts
DataStructures::Queue
< SystemAddress
_completedConnectionAttempts

Detailed Description

Definition at line 19 of file PacketizedTCP.h.


Constructor & Destructor Documentation

PacketizedTCP::PacketizedTCP (  ) 

Definition at line 12 of file PacketizedTCP.cpp.

PacketizedTCP::~PacketizedTCP (  )  [virtual]

Definition at line 16 of file PacketizedTCP.cpp.

Here is the call graph for this function:


Member Function Documentation

void PacketizedTCP::AddToConnectionList ( SystemAddress  sa  )  [protected]

Definition at line 358 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void PacketizedTCP::AttachPlugin ( PluginInterface2 plugin  ) 

Definition at line 311 of file PacketizedTCP.cpp.

Here is the call graph for this function:

void PacketizedTCP::ClearAllConnections ( void   )  [protected]

Definition at line 364 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void PacketizedTCP::CloseConnection ( SystemAddress  systemAddress  ) 

Disconnects a player/address.

Reimplemented from TCPInterface.

Definition at line 336 of file PacketizedTCP.cpp.

Here is the call graph for this function:

void PacketizedTCP::DetachPlugin ( PluginInterface2 plugin  ) 

Definition at line 320 of file PacketizedTCP.cpp.

Here is the call graph for this function:

SystemAddress PacketizedTCP::HasCompletedConnectionAttempt ( void   ) 

Has a previous call to connect succeeded?

Returns:
UNASSIGNED_SYSTEM_ADDRESS = no. Anything else means yes.

Reimplemented from TCPInterface.

Definition at line 371 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

SystemAddress PacketizedTCP::HasFailedConnectionAttempt ( void   ) 

Has a previous call to connect failed?

Returns:
UNASSIGNED_SYSTEM_ADDRESS = no. Anything else means yes.

Reimplemented from TCPInterface.

Definition at line 379 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

SystemAddress PacketizedTCP::HasLostConnection ( void   ) 

Queued events of lost connections.

Reimplemented from TCPInterface.

Definition at line 395 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

SystemAddress PacketizedTCP::HasNewIncomingConnection ( void   ) 

Queued events of new incoming connections.

Reimplemented from TCPInterface.

Definition at line 387 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void PacketizedTCP::PushNotificationsToQueues ( void   )  [protected]

Definition at line 101 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Packet * PacketizedTCP::Receive ( void   ) 

Returns data received.

Reimplemented from TCPInterface.

Definition at line 150 of file PacketizedTCP.cpp.

Here is the call graph for this function:

void PacketizedTCP::RemoveFromConnectionList ( SystemAddress  sa  )  [protected]

Definition at line 344 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Packet * PacketizedTCP::ReturnOutgoingPacket ( void   )  [protected]

Definition at line 283 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void PacketizedTCP::Send ( const char *  data,
unsigned  length,
SystemAddress  systemAddress,
bool  broadcast 
)

Sends a byte stream.

Definition at line 44 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool PacketizedTCP::SendList ( const char **  data,
const int *  lengths,
const int  numParameters,
SystemAddress  systemAddress,
bool  broadcast 
)

Definition at line 63 of file PacketizedTCP.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool PacketizedTCP::Start ( unsigned short  port,
unsigned short  maxIncomingConnections,
int  threadPriority = -99999 
)

Starts the TCP server on the indicated port

Parameters:
[in] threadPriority Passed to thread creation routine. Use THREAD_PRIORITY_NORMAL for Windows. WARNING!!! On Linux, 0 means highest priority! You MUST set this to something valid based on the values used by your other threads

Definition at line 21 of file PacketizedTCP.cpp.

Here is the call graph for this function:

void PacketizedTCP::Stop ( void   ) 

Stops the TCP server.

Reimplemented from TCPInterface.

Definition at line 33 of file PacketizedTCP.cpp.

Here is the call graph for this function:


Member Data Documentation

Definition at line 76 of file PacketizedTCP.h.

Definition at line 76 of file PacketizedTCP.h.

Definition at line 76 of file PacketizedTCP.h.

Definition at line 76 of file PacketizedTCP.h.

Definition at line 73 of file PacketizedTCP.h.

Definition at line 70 of file PacketizedTCP.h.

Definition at line 72 of file PacketizedTCP.h.


The documentation for this class was generated from the following files: