![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
#include <TCPInterface.h>
Inheritance diagram for RakNet::TCPInterface:Classes | |
| struct | ThisPtrPlusSysAddr |
Public Member Functions | |
| Packet * | AllocatePacket (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) |
| Packet * | Receive (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 TCPInterface * | GetInstance (void) |
Protected Member Functions | |
| SOCKET | SocketConnect (const char *host, unsigned short remotePort, unsigned short socketFamily) |
Protected Attributes | |
| DataStructures::List< SOCKET > | blockingSocketList |
| 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 |
| RemoteClient * | remoteClients |
| int | remoteClientsLength |
| DataStructures::ThreadsafeAllocatingQueue < SystemAddress > | requestedCloseConnections |
| DataStructures::Queue< Packet * > | tailPush |
| int | threadPriority |
| bool | threadRunning |
Friends | |
| void * | ConnectionAttemptLoop (void *arguments) |
| void * | UpdateTCPInterfaceLoop (void *arguments) |
Definition at line 41 of file TCPInterface.h.
| RakNet::TCPInterface::TCPInterface | ( | ) |
| virtual RakNet::TCPInterface::~TCPInterface | ( | ) | [virtual] |
| 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
| [out] | remoteSystems | An 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] | numberOfSystems | As 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?
Reimplemented in RakNet::PacketizedTCP.
| SystemAddress RakNet::TCPInterface::HasFailedConnectionAttempt | ( | void | ) |
Has a previous call to connect failed?
Reimplemented in RakNet::PacketizedTCP.
| SystemAddress RakNet::TCPInterface::HasLostConnection | ( | void | ) |
Reimplemented in RakNet::PacketizedTCP.
| SystemAddress RakNet::TCPInterface::HasNewIncomingConnection | ( | void | ) |
Reimplemented in RakNet::PacketizedTCP.
| 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
| [in] | port | Which port to listen on. |
| [in] | maxIncomingConnections | Max incoming connections we will accept |
| [in] | maxConnections | Max total connections, which should be >= maxIncomingConnections |
| [in] | threadPriority | Passed 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] | socketFamily | IP 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 |
| void* ConnectionAttemptLoop | ( | void * | arguments | ) | [friend] |
| void* UpdateTCPInterfaceLoop | ( | void * | arguments | ) | [friend] |
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.
DataStructures::Queue<Packet*> RakNet::TCPInterface::headPush [protected] |
Definition at line 134 of file TCPInterface.h.
DataStructures::ThreadsafeAllocatingQueue<Packet> RakNet::TCPInterface::incomingMessages [protected] |
Definition at line 158 of file TCPInterface.h.
bool RakNet::TCPInterface::isStarted [protected] |
Definition at line 131 of file TCPInterface.h.
SOCKET RakNet::TCPInterface::listenSocket [protected] |
Definition at line 132 of file TCPInterface.h.
DataStructures::ThreadsafeAllocatingQueue<SystemAddress> RakNet::TCPInterface::lostConnections [protected] |
Definition at line 159 of file TCPInterface.h.
DataStructures::ThreadsafeAllocatingQueue<SystemAddress> RakNet::TCPInterface::newIncomingConnections [protected] |
Definition at line 159 of file TCPInterface.h.
DataStructures::ThreadsafeAllocatingQueue<RemoteClient*> RakNet::TCPInterface::newRemoteClients [protected] |
Definition at line 160 of file TCPInterface.h.
RemoteClient* RakNet::TCPInterface::remoteClients [protected] |
Definition at line 135 of file TCPInterface.h.
int RakNet::TCPInterface::remoteClientsLength [protected] |
Definition at line 136 of file TCPInterface.h.
DataStructures::ThreadsafeAllocatingQueue<SystemAddress> RakNet::TCPInterface::requestedCloseConnections [protected] |
Definition at line 159 of file TCPInterface.h.
DataStructures::Queue<Packet*> RakNet::TCPInterface::tailPush [protected] |
Definition at line 134 of file TCPInterface.h.
int RakNet::TCPInterface::threadPriority [protected] |
Definition at line 164 of file TCPInterface.h.
bool RakNet::TCPInterface::threadRunning [protected] |
Definition at line 131 of file TCPInterface.h.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.