Drag[en]gine Script Module DragonScript
1.21
|
Public Member Functions | |
Constructors | |
Connection | new () |
Create connection. More... | |
Management | |
String | getLocalAddress () |
Llocal address. More... | |
String | getRemoteAddress () |
Remote address. More... | |
bool | getConnected () |
Connection is established. More... | |
bool | connectTo (String address) |
Connect to host at address. More... | |
void | disconnect () |
Disconnect if connected. More... | |
void | sendMessage (NetworkMessage message, int maxDelay) |
Send message if connected. More... | |
void | sendReliableMessage (NetworkMessage message) |
Send reliable message if connected. More... | |
void | linkState (NetworkMessage message, NetworkState state, bool readOnly) |
Link network state to remote network state. More... | |
ConnectionListener | getConnectionListener () |
Connection listener or null if not set. More... | |
void | setConnectionListener (ConnectionListener listener) |
Set connection listener or null if not set. More... | |
This is a native class.
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() .
void Dragengine.Networking.Connection.disconnect | ( | ) |
Disconnect if connected.
bool Dragengine.Networking.Connection.getConnected | ( | ) |
Connection is established.
ConnectionListener Dragengine.Networking.Connection.getConnectionListener | ( | ) |
Connection listener or null if not set.
String Dragengine.Networking.Connection.getLocalAddress | ( | ) |
Llocal address.
String Dragengine.Networking.Connection.getRemoteAddress | ( | ) |
Remote address.
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.
message | Contains information for the remote system to know what state to link to. |
state | State to link with remote system. |
readOnly | If true remote state is not allowed to change. |
Connection Dragengine.Networking.Connection.new | ( | ) |
Create connection.
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.
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.
void Dragengine.Networking.Connection.setConnectionListener | ( | ConnectionListener | listener | ) |
Set connection listener or null if not set.