Connection Class. More...
#include <deConnection.h>
Public Member Functions | |
Constructors and Destructors | |
| deConnection (deConnectionManager *manager) | |
| Creates a new connection object. | |
| virtual | ~deConnection () |
| Cleans up the connection object. | |
Management | |
| const char * | GetLocalAddress () const |
| Retrieves the local address. | |
| void | SetLocalAddress (const char *address) |
| Sets the local address. | |
| const char * | GetRemoteAddress () const |
| Retrieves the remove address. | |
| void | SetRemoteAddress (const char *address) |
| Sets the remote address. | |
| bool | GetConnected () const |
| Determines if a connection to a remote host is established. | |
| void | SetConnected (bool connected) |
| Sets if a connection to a remote host is established. | |
| bool | ConnectTo (const char *address) |
| Connects to the a connection object on the host at the given address. | |
| void | Disconnect () |
| Disconnects from a remote connection if connected. | |
| void | SendMessage (const char *message, int length, int maxDelay) |
| Sends a message to the remote connection if connected. | |
| void | SendReliableMessage (const char *message, int length) |
| Sens a reliable message to the remote connection if connected. | |
| void | LinkState (const char *message, int length, deNetworkState *state) |
| Links a network state to a remote network state. | |
System Peers | |
| deBaseNetworkConnection * | GetNetworkConnection () const |
| Retrieves the network system peer object. | |
| void | SetNetworkConnection (deBaseNetworkConnection *netCon) |
| Sets the network system peer object. | |
| deBaseScriptingConnection * | GetScriptingConnection () const |
| Retrieves the scripting system peer object. | |
| void | SetScriptingConnection (deBaseScriptingConnection *scrCon) |
| Sets the scripting system peer object. | |
Connection Class.
Manages a connection in a network game. Connections are usually made between the player and a server but can also be established between servers themselves or between individual players.
| deConnection::deConnection | ( | deConnectionManager * | manager ) |
Creates a new connection object.
| virtual deConnection::~deConnection | ( | ) | [virtual] |
Cleans up the connection object.
| bool deConnection::ConnectTo | ( | const char * | address ) |
Connects to the a connection object on the host at the given address.
Returns true if the connection request has been send or false if an error occured. Connection success or failure is reported through the scripting peer. The format of the address is specific to the network module.
| void deConnection::Disconnect | ( | ) |
Disconnects from a remote connection if connected.
| bool deConnection::GetConnected | ( | ) | const [inline] |
Determines if a connection to a remote host is established.
| const char* deConnection::GetLocalAddress | ( | ) | const [inline] |
Retrieves the local address.
| deBaseNetworkConnection* deConnection::GetNetworkConnection | ( | ) | const [inline] |
Retrieves the network system peer object.
| const char* deConnection::GetRemoteAddress | ( | ) | const [inline] |
Retrieves the remove address.
| deBaseScriptingConnection* deConnection::GetScriptingConnection | ( | ) | const [inline] |
Retrieves the scripting system peer object.
| void deConnection::LinkState | ( | const char * | message, |
| int | length, | ||
| deNetworkState * | state | ||
| ) |
Links a network state to a remote network state.
The message contains informations for the remote system to know what state to link to. The request is queued and carried out as soon as possible. The local state is considered the master state and the remote state the slave state. By default only the master state can apply changes.
| void deConnection::SendMessage | ( | const char * | message, |
| int | length, | ||
| int | maxDelay | ||
| ) |
Sends a message to the remote connection if connected.
The message can be queued and send at a later time to optimize throughput. The message will be not delayed longer than the given amount of milliseconds. The message is send unreliable and it is acceptable for the message to get lost due to transmission failure.
| void deConnection::SendReliableMessage | ( | const char * | message, |
| int | length | ||
| ) |
Sens a reliable message to the remote connection if connected.
The message is append to already waiting reliable messages and send as soon as possible. Reliable messages always arrive in the same order they have been queued.
| void deConnection::SetConnected | ( | bool | connected ) |
Sets if a connection to a remote host is established.
Intended to be used by the network module only so do not call otherwise.
| void deConnection::SetLocalAddress | ( | const char * | address ) |
Sets the local address.
Intended to be used by the network module only so do not call it otherwise.
| void deConnection::SetNetworkConnection | ( | deBaseNetworkConnection * | netCon ) |
Sets the network system peer object.
| void deConnection::SetRemoteAddress | ( | const char * | address ) |
Sets the remote address.
Intended to be used by the network module only so do not call otherwise.
| void deConnection::SetScriptingConnection | ( | deBaseScriptingConnection * | scrCon ) |
Sets the scripting system peer object.
1.7.2