#include <networking.h>
Public Member Functions | |
const string | GetClientHost (const uint index) |
const uint | GetClientNum () |
const uint | GetClientMax () |
const OPENCITY_NET_CODE | GetMachineRole () |
const uint | GetPingTimeout () |
const uint | GetServerNum () |
const string | GetServerHost (const uint index) |
const string | GetVersion () |
const string | GetProtocol () |
const OPENCITY_NET_CODE | Accept (uint &rid) |
const OPENCITY_NET_CODE | Reject (const uint id) |
const OPENCITY_NET_CODE | StartServer (const OC_SUINT port=OC_NET_SERVER_PORT) |
const OPENCITY_NET_CODE | StopServer () |
const OPENCITY_NET_CODE | ProcessServerData () |
const OPENCITY_NET_CODE | Open (const string serverHost, const OC_SUINT port=OC_NET_SERVER_PORT) |
const OPENCITY_NET_CODE | Close () |
const OPENCITY_NET_CODE | Close (ClientIter i) |
const OPENCITY_NET_CODE | Send (const void *const data, const uint len) |
const OPENCITY_NET_CODE | Send (const void *const data, const uint len, const uint cid) |
const OPENCITY_NET_CODE | SendMessage (NetMessage &rMsg) |
const OPENCITY_NET_CODE | SendMessage (NetMessage &rMsg, const uint cid) |
const OPENCITY_NET_CODE | Receive (void *const data, const uint maxlen) |
const OPENCITY_NET_CODE | ReceiveMessage (NetMessage &rMsg) |
const OPENCITY_NET_CODE | Receive (void *const data, const uint maxlen, const uint cid) |
Private Attributes | |
OPENCITY_NET_CODE | networkingCode |
bool | boolNetworkInitialized |
std::vector< Netnode > | vClient |
SDLNet_SocketSet | pSocketSet |
The server puts all its client sockets into this set. | |
TCPsocket | pServerSocket |
Definition at line 125 of file networking.h.
|
SERVER: Accept the connection request from a machine.
Definition at line 138 of file networking.cpp. References NetMessage::cmd, Netnode::ip, SendMessage(), and Netnode::socket. Referenced by ProcessServerData(). |
|
SERVER: close the connection to a client CLIENT: this command is not available
Definition at line 379 of file networking.cpp. |
|
SERVER: close the connection to a super server CLIENT: close the connection to a server
Definition at line 360 of file networking.cpp. References NetMessage::cmd, pServerSocket, and SendMessage(). Referenced by ProcessServerData(). |
|
Definition at line 58 of file networking.cpp. |
|
Definition at line 76 of file networking.cpp. |
|
Definition at line 68 of file networking.cpp. |
|
Definition at line 92 of file networking.cpp. |
|
Definition at line 130 of file networking.cpp. |
|
Definition at line 111 of file networking.cpp. |
|
Definition at line 100 of file networking.cpp. |
|
Definition at line 122 of file networking.cpp. |
|
SERVER: try to connect to a another server CLIENT: try to connect to a server
Definition at line 309 of file networking.cpp. References NetMessage::cmd, and pServerSocket. |
|
SERVER: check the avaibility of data sent by clients and process them. This is a non-blocking call
Definition at line 253 of file networking.cpp. References Accept(), Close(), and NetMessage::cmd. |
|
SERVER: read the data sent by a super server specified by its index CLIENT: this method is _not_ available to a client
Definition at line 520 of file networking.cpp. |
|
SERVER: read the data sent by a super server CLIENT: read the data sent by the server
Definition at line 480 of file networking.cpp. Referenced by ReceiveMessage(). |
|
Wait for the specified incoming command. SERVER: wait for the command sent by a super server CLIENT: wait for the command sent by a server
Definition at line 506 of file networking.cpp. References Receive(). |
|
SERVER: Reject the connection request from a machine. Definition at line 188 of file networking.cpp. |
|
SERVER: send the data to a client CLIENT: this method is _not_ available to a client machine
Definition at line 428 of file networking.cpp. |
|
SERVER: send the data to a super server CLIENT: send the data to the server
Definition at line 402 of file networking.cpp. Referenced by SendMessage(). |
|
SERVER: send the message to a super server CLIENT: this method is _not_ available to a client host Definition at line 468 of file networking.cpp. References NetMessage::dataLength, and Send(). |
|
SERVER: send the message to a super server CLIENT: send the message to a server Definition at line 454 of file networking.cpp. References NetMessage::dataLength, and Send(). |
|
SERVER: Create a new socket and begin to listen for incoming connection requests. Return the following enumerations: OC_SERVER_READY OC_SERVER_STARTED Definition at line 198 of file networking.cpp. References pServerSocket, and pSocketSet. |
|
SERVER: close the server socket and free all server's ressources.
Definition at line 234 of file networking.cpp. References pServerSocket, and pSocketSet. |
|
The server listens on this socket The client use this socket to communicate with the server Definition at line 374 of file networking.h. Referenced by Close(), Open(), StartServer(), and StopServer(). |