SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SLNet::PacketizedTCP Class Reference

`#include <slikenet/PacketizedTCP.h>`

Inheritance diagram for SLNet::PacketizedTCP:

## Public Member Functions

| PacketizedTCP ()
virtual | ~PacketizedTCP ()
void | Stop (void)
| Stops the TCP server.
void | Send (const char *data, unsigned length, const SystemAddress &systemAddress, bool broadcast)
| Sends a byte stream.
bool | SendList (const char **data, const unsigned int *lengths, const int numParameters, const SystemAddress &systemAddress, bool broadcast)
Packet * | Receive (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.
Public Member Functions inherited from SLNet::TCPInterface
| TCPInterface ()
virtual | ~TCPInterface ()
bool | Start (unsigned short port, unsigned short maxIncomingConnections, unsigned short maxConnections=0, int _threadPriority=-99999, unsigned short socketFamily=AF_INET, const char *bindAddress=0)
void | Stop (void)
| Stops the TCP server.
SystemAddress | Connect (const char *host, unsigned short remotePort, bool block=true, unsigned short socketFamily=AF_INET, const char *bindAddress=0)
| Connect to the specified host on the specified port.
virtual void | Send (const char *data, unsigned int length, const SystemAddress &systemAddress, bool broadcast)
| Sends a byte stream.
unsigned int | GetOutgoingDataBufferSize (SystemAddress systemAddress) const
virtual bool | ReceiveHasPackets (void)
void | CloseConnection (SystemAddress systemAddress)
| Disconnects a player/address.
void | DeallocatePacket (Packet *packet)
| Deallocates a packet returned by Receive.
void | GetConnectionList (SystemAddress *remoteSystems, unsigned short *numberOfSystems) const
unsigned short | GetConnectionCount (void) const
| Returns just the number of connections we have.
SystemAddress | HasCompletedConnectionAttempt (void)
SystemAddress | HasFailedConnectionAttempt (void)
SystemAddress | HasNewIncomingConnection (void)
| Queued events of new incoming connections.
SystemAddress | HasLostConnection (void)
| Queued events of lost connections.
Packet * | AllocatePacket (unsigned dataSize)
| Return an allocated but empty packet, for custom use.
virtual void | PushBackPacket (Packet *packet, bool pushAtHead)
bool | WasStarted (void) const
| Returns if Start() was called successfully.
void | AttachPlugin (PluginInterface2 *plugin)
void | DetachPlugin (PluginInterface2 *plugin)

## Protected Member Functions

void | ClearAllConnections (void)
void | RemoveFromConnectionList (const SystemAddress &sa)
void | AddToConnectionList (const SystemAddress &sa)
void | PushNotificationsToQueues (void)
Packet * | ReturnOutgoingPacket (void)
Protected Member Functions inherited from SLNet::TCPInterface
Packet * | ReceiveInt (void)
bool | CreateListenSocket (unsigned short port, unsigned short maxIncomingConnections, unsigned short socketFamily, const char *hostAddress)
friend | RAK_THREAD_DECLARATION (UpdateTCPInterfaceLoop)
friend | RAK_THREAD_DECLARATION (ConnectionAttemptLoop)
__TCPSOCKET__ | SocketConnect (const char *host, unsigned short remotePort, unsigned short socketFamily, const char *bindAddress)

## Protected Attributes

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
Protected Attributes inherited from SLNet::TCPInterface
DataStructures::List < PluginInterface2 * > | messageHandlerList
SLNet::LocklessUint32_t | isStarted
SLNet::LocklessUint32_t | threadRunning
__TCPSOCKET__ | listenSocket
DataStructures::Queue< Packet * > | headPush
DataStructures::Queue< Packet * > | tailPush
RemoteClient * | remoteClients
unsigned short | remoteClientsLength
DataStructures::ThreadsafeAllocatingQueue < Packet > | incomingMessages
DataStructures::ThreadsafeAllocatingQueue < SystemAddress > | newIncomingConnections
DataStructures::ThreadsafeAllocatingQueue < SystemAddress > | lostConnections
DataStructures::ThreadsafeAllocatingQueue < SystemAddress > | requestedCloseConnections
DataStructures::ThreadsafeAllocatingQueue < RemoteClient * > | newRemoteClients
SimpleMutex | completedConnectionAttemptMutex
SimpleMutex | failedConnectionAttemptMutex
DataStructures::Queue < SystemAddress > | completedConnectionAttempts
DataStructures::Queue < SystemAddress > | failedConnectionAttempts
int | threadPriority
DataStructures::List < __TCPSOCKET__ > | blockingSocketList
SimpleMutex | blockingSocketListMutex

## Detailed Description

Definition at line 34 of file PacketizedTCP.h.

## Constructor & Destructor Documentation

SLNet::PacketizedTCP::PacketizedTCP | ( |  | ) |

virtual SLNet::PacketizedTCP::~PacketizedTCP | ( |  | ) |

virtual

## Member Function Documentation

void SLNet::PacketizedTCP::AddToConnectionList | ( | const SystemAddress & | sa | ) |

protected

void SLNet::PacketizedTCP::ClearAllConnections | ( | void |  | ) |

protected

void SLNet::PacketizedTCP::CloseConnection | ( | SystemAddress | systemAddress | ) |

Disconnects a player/address.

SystemAddress SLNet::PacketizedTCP::HasCompletedConnectionAttempt | ( | void |  | ) |

Has a previous call to connect succeeded?

Returns
  UNASSIGNED_SYSTEM_ADDRESS = no. Anything else means yes.

SystemAddress SLNet::PacketizedTCP::HasFailedConnectionAttempt | ( | void |  | ) |

Has a previous call to connect failed?

Returns
  UNASSIGNED_SYSTEM_ADDRESS = no. Anything else means yes.

SystemAddress SLNet::PacketizedTCP::HasLostConnection | ( | void |  | ) |

Queued events of lost connections.

SystemAddress SLNet::PacketizedTCP::HasNewIncomingConnection | ( | void |  | ) |

Queued events of new incoming connections.

void SLNet::PacketizedTCP::PushNotificationsToQueues | ( | void |  | ) |

protected

Packet* SLNet::PacketizedTCP::Receive | ( | void |  | ) |

virtual

Returns data received.

Reimplemented from SLNet::TCPInterface.

void SLNet::PacketizedTCP::RemoveFromConnectionList | ( | const SystemAddress & | sa | ) |

protected

Packet* SLNet::PacketizedTCP::ReturnOutgoingPacket | ( | void |  | ) |

protected

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

Sends a byte stream.

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

virtual

Reimplemented from SLNet::TCPInterface.

void SLNet::PacketizedTCP::Stop | ( | void |  | ) |

Stops the TCP server.

## Member Data Documentation

DataStructures::Queue<SystemAddress> SLNet::PacketizedTCP::_completedConnectionAttempts

protected

Definition at line 84 of file PacketizedTCP.h.

DataStructures::Queue<SystemAddress> SLNet::PacketizedTCP::_failedConnectionAttempts

protected

Definition at line 84 of file PacketizedTCP.h.

DataStructures::Queue<SystemAddress> SLNet::PacketizedTCP::_lostConnections

protected

Definition at line 84 of file PacketizedTCP.h.

DataStructures::Queue<SystemAddress> SLNet::PacketizedTCP::_newIncomingConnections

protected

Definition at line 84 of file PacketizedTCP.h.

DataStructures::Map<SystemAddress, DataStructures::ByteQueue *> SLNet::PacketizedTCP::connections

protected

Definition at line 81 of file PacketizedTCP.h.

DataStructures::Queue<Packet*> SLNet::PacketizedTCP::waitingPackets

protected

Definition at line 80 of file PacketizedTCP.h.

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

- Source/include/slikenet/PacketizedTCP.h