Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Networking.Connection Class Reference

Connection. More...

Inheritance diagram for Dragengine.Networking.Connection:

Public Member Functions

Constructors
Connection new ()
 Create connection.
Management
String getLocalAddress ()
 Llocal address.
String getRemoteAddress ()
 Remote address.
bool getConnected ()
 Connection is established.
bool connectTo (String address)
 Connect to host at address.
void disconnect ()
 Disconnect if connected.
void sendMessage (NetworkMessage message, int maxDelay)
 Send message if connected.
void sendReliableMessage (NetworkMessage message)
 Send reliable message if connected.
void linkState (NetworkMessage message, NetworkState state, bool readOnly)
 Link network state to remote network state.
ConnectionListener getConnectionListener ()
 Connection listener or null if not set.
void setConnectionListener (ConnectionListener listener)
 Set connection listener or null if not set.

Detailed Description

Connection.

This is a native class.

Member Function Documentation

◆ connectTo()

bool Dragengine.Networking.Connection.connectTo ( String address)

Connect to host at address.

Connection success or failure is reported through the scripting peer. For the supported address format see Server.listenOn() .

Returns
true if the connection request has been send or false in case of error.

Referenced by disconnect().

◆ disconnect()

void Dragengine.Networking.Connection.disconnect ( )

Disconnect if connected.

References connectTo(), and disconnect().

Referenced by disconnect().

◆ getConnected()

bool Dragengine.Networking.Connection.getConnected ( )

Connection is established.

References getConnected(), and getRemoteAddress().

Referenced by getConnected().

◆ getConnectionListener()

ConnectionListener Dragengine.Networking.Connection.getConnectionListener ( )

Connection listener or null if not set.

Referenced by setConnectionListener().

◆ getLocalAddress()

String Dragengine.Networking.Connection.getLocalAddress ( )

Llocal address.

References getLocalAddress().

Referenced by getLocalAddress().

◆ getRemoteAddress()

String Dragengine.Networking.Connection.getRemoteAddress ( )

Remote address.

Referenced by getConnected().

◆ linkState()

void Dragengine.Networking.Connection.linkState ( NetworkMessage message,
NetworkState state,
bool readOnly )

Link network state to remote network state.

Request is queued and carried out as soon as possible. The local state is considered the server state and the remote state the client state. The server state can always change values. The client state can only change values if allowed by the server state. Typically only the server sends out link request to clients. All these states are read only except those states belonging to the client which he has to be able to modify.

Parameters
messageContains information for the remote system to know what state to link to.
stateState to link with remote system.
readOnlyIf true remote state is not allowed to change.

Referenced by setConnectionListener().

◆ new()

Connection Dragengine.Networking.Connection.new ( )

Create connection.

References new().

Referenced by new().

◆ sendMessage()

void Dragengine.Networking.Connection.sendMessage ( NetworkMessage message,
int maxDelay )

Send message 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.

Referenced by sendReliableMessage().

◆ sendReliableMessage()

void Dragengine.Networking.Connection.sendReliableMessage ( NetworkMessage message)

Send reliable message 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.

References sendMessage(), and sendReliableMessage().

Referenced by sendReliableMessage().

◆ setConnectionListener()

void Dragengine.Networking.Connection.setConnectionListener ( ConnectionListener listener)

Set connection listener or null if not set.

References getConnectionListener(), linkState(), and setConnectionListener().

Referenced by setConnectionListener().


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