Shadowrun: Awakened 29 September 2011 - Build 871
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
RakNet::TCPInterface Class Reference

#include <TCPInterface.h>

Inheritance diagram for RakNet::TCPInterface:

List of all members.

Classes

struct  ThisPtrPlusSysAddr

Public Member Functions

PacketAllocatePacket (unsigned dataSize)
 Return an allocated but empty packet, for custom use.
void CloseConnection (SystemAddress systemAddress)
 Disconnects a player/address.
SystemAddress Connect (const char *host, unsigned short remotePort, bool block=true, unsigned short socketFamily=AF_INET)
 Connect to the specified host on the specified port.
void DeallocatePacket (Packet *packet)
 Deallocates a packet returned by Receive.
unsigned short GetConnectionCount (void) const
 Returns just the number of connections we have.
void GetConnectionList (SystemAddress *remoteSystems, unsigned short *numberOfSystems) const
unsigned int GetOutgoingDataBufferSize (SystemAddress systemAddress) const
SystemAddress HasCompletedConnectionAttempt (void)
SystemAddress HasFailedConnectionAttempt (void)
SystemAddress HasLostConnection (void)
 Queued events of lost connections.
SystemAddress HasNewIncomingConnection (void)
 Queued events of new incoming connections.
virtual void PushBackPacket (Packet *packet, bool pushAtHead)
PacketReceive (void)
 Returns data received.
bool ReceiveHasPackets (void)
 Returns if Receive() will return data.
void Send (const char *data, unsigned int 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)
bool Start (unsigned short port, unsigned short maxIncomingConnections, unsigned short maxConnections=0, int _threadPriority=-99999, unsigned short socketFamily=AF_INET)
void Stop (void)
 Stops the TCP server.
 TCPInterface ()
bool WasStarted (void) const
 Returns if Start() was called successfully.
virtual ~TCPInterface ()

Static Public Member Functions

static int Base64Encoding (const char *inputData, int dataLength, char *outputData)
 Returns how many bytes were written.
static const char * Base64Map (void)
static void DestroyInstance (TCPInterface *i)
static TCPInterfaceGetInstance (void)

Protected Member Functions

SOCKET SocketConnect (const char *host, unsigned short remotePort, unsigned short socketFamily)

Protected Attributes

DataStructures::List< SOCKETblockingSocketList
SimpleMutex blockingSocketListMutex
SimpleMutex completedConnectionAttemptMutex
DataStructures::Queue
< SystemAddress
completedConnectionAttempts
SimpleMutex failedConnectionAttemptMutex
DataStructures::Queue
< SystemAddress
failedConnectionAttempts
DataStructures::Queue< Packet * > headPush
DataStructures::ThreadsafeAllocatingQueue
< Packet
incomingMessages
bool isStarted
SOCKET listenSocket
DataStructures::ThreadsafeAllocatingQueue
< SystemAddress
lostConnections
DataStructures::ThreadsafeAllocatingQueue
< SystemAddress
newIncomingConnections
DataStructures::ThreadsafeAllocatingQueue
< RemoteClient * > 
newRemoteClients
RemoteClientremoteClients
int remoteClientsLength
DataStructures::ThreadsafeAllocatingQueue
< SystemAddress
requestedCloseConnections
DataStructures::Queue< Packet * > tailPush
int threadPriority
bool threadRunning

Friends

void * ConnectionAttemptLoop (void *arguments)
void * UpdateTCPInterfaceLoop (void *arguments)

Detailed Description

Definition at line 41 of file TCPInterface.h.


Constructor & Destructor Documentation

RakNet::TCPInterface::TCPInterface ( )
virtual RakNet::TCPInterface::~TCPInterface ( ) [virtual]

Member Function Documentation

Packet* RakNet::TCPInterface::AllocatePacket ( unsigned  dataSize)
static int RakNet::TCPInterface::Base64Encoding ( const char *  inputData,
int  dataLength,
char *  outputData 
) [static]
static const char* RakNet::TCPInterface::Base64Map ( void  ) [inline, static]

Definition at line 121 of file TCPInterface.h.

{return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";}
void RakNet::TCPInterface::CloseConnection ( SystemAddress  systemAddress)

Reimplemented in RakNet::PacketizedTCP.

SystemAddress RakNet::TCPInterface::Connect ( const char *  host,
unsigned short  remotePort,
bool  block = true,
unsigned short  socketFamily = AF_INET 
)
void RakNet::TCPInterface::DeallocatePacket ( Packet packet)
static void RakNet::TCPInterface::DestroyInstance ( TCPInterface i) [static]
unsigned short RakNet::TCPInterface::GetConnectionCount ( void  ) const
void RakNet::TCPInterface::GetConnectionList ( SystemAddress remoteSystems,
unsigned short *  numberOfSystems 
) const

Fills the array remoteSystems with the SystemAddress of all the systems we are connected to

Parameters:
[out]remoteSystemsAn array of SystemAddress structures to be filled with the SystemAddresss of the systems we are connected to. Pass 0 to remoteSystems to only get the number of systems we are connected to
[in,out]numberOfSystemsAs input, the size of remoteSystems array. As output, the number of elements put into the array
static TCPInterface* RakNet::TCPInterface::GetInstance ( void  ) [static]

Reimplemented in RakNet::PacketizedTCP.

unsigned int RakNet::TCPInterface::GetOutgoingDataBufferSize ( SystemAddress  systemAddress) const
SystemAddress RakNet::TCPInterface::HasCompletedConnectionAttempt ( void  )

Has a previous call to connect succeeded?

Returns:
UNASSIGNED_SYSTEM_ADDRESS = no. Anything else means yes.

Reimplemented in RakNet::PacketizedTCP.

SystemAddress RakNet::TCPInterface::HasFailedConnectionAttempt ( void  )

Has a previous call to connect failed?

Returns:
UNASSIGNED_SYSTEM_ADDRESS = no. Anything else means yes.

Reimplemented in RakNet::PacketizedTCP.

SystemAddress RakNet::TCPInterface::HasLostConnection ( void  )

Reimplemented in RakNet::PacketizedTCP.

SystemAddress RakNet::TCPInterface::HasNewIncomingConnection ( void  )

Reimplemented in RakNet::PacketizedTCP.

virtual void RakNet::TCPInterface::PushBackPacket ( Packet packet,
bool  pushAtHead 
) [virtual]
Packet* RakNet::TCPInterface::Receive ( void  )

Reimplemented in RakNet::PacketizedTCP.

bool RakNet::TCPInterface::ReceiveHasPackets ( void  )
void RakNet::TCPInterface::Send ( const char *  data,
unsigned int  length,
const SystemAddress systemAddress,
bool  broadcast 
)
bool RakNet::TCPInterface::SendList ( const char **  data,
const unsigned int *  lengths,
const int  numParameters,
const SystemAddress systemAddress,
bool  broadcast 
)
SOCKET RakNet::TCPInterface::SocketConnect ( const char *  host,
unsigned short  remotePort,
unsigned short  socketFamily 
) [protected]
bool RakNet::TCPInterface::Start ( unsigned short  port,
unsigned short  maxIncomingConnections,
unsigned short  maxConnections = 0,
int  _threadPriority = -99999,
unsigned short  socketFamily = AF_INET 
)

Starts the TCP server on the indicated port

Parameters:
[in]portWhich port to listen on.
[in]maxIncomingConnectionsMax incoming connections we will accept
[in]maxConnectionsMax total connections, which should be >= maxIncomingConnections
[in]threadPriorityPassed to the thread creation routine. Use THREAD_PRIORITY_NORMAL for Windows. For Linux based systems, you MUST pass something reasonable based on the thread priorities for your application.
[in]socketFamilyIP version: For IPV4, use AF_INET (default). For IPV6, use AF_INET6. To autoselect, use AF_UNSPEC.
void RakNet::TCPInterface::Stop ( void  )

Reimplemented in RakNet::PacketizedTCP.

bool RakNet::TCPInterface::WasStarted ( void  ) const

Friends And Related Function Documentation

void* ConnectionAttemptLoop ( void *  arguments) [friend]
void* UpdateTCPInterfaceLoop ( void *  arguments) [friend]

Member Data Documentation

Definition at line 166 of file TCPInterface.h.

Definition at line 167 of file TCPInterface.h.

Definition at line 161 of file TCPInterface.h.

Definition at line 162 of file TCPInterface.h.

Definition at line 161 of file TCPInterface.h.

Definition at line 162 of file TCPInterface.h.

Definition at line 134 of file TCPInterface.h.

Definition at line 158 of file TCPInterface.h.

Definition at line 131 of file TCPInterface.h.

Definition at line 132 of file TCPInterface.h.

Definition at line 159 of file TCPInterface.h.

Definition at line 159 of file TCPInterface.h.

Definition at line 160 of file TCPInterface.h.

Definition at line 135 of file TCPInterface.h.

Definition at line 136 of file TCPInterface.h.

Definition at line 159 of file TCPInterface.h.

Definition at line 134 of file TCPInterface.h.

Definition at line 164 of file TCPInterface.h.

Definition at line 131 of file TCPInterface.h.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net