Drag[en]gine Script Module DragonScript Script API  1.0
Connection Class Reference

Connection. More...

Inheritance diagram for Connection:

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 (String message, NetworkState state)
 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...
 

Detailed Description

Connection.

This is a native class.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ connectTo()

bool connectTo ( String  address)

Connect to host at address.

Connection success or failure is reported through the scripting peer. The format of the address is specific to the network module.

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

§ disconnect()

void disconnect ( )

Disconnect if connected.

§ getConnected()

bool getConnected ( )

Connection is established.

§ getConnectionListener()

ConnectionListener getConnectionListener ( )

Connection listener or null if not set.

§ getLocalAddress()

String getLocalAddress ( )

Llocal address.

§ getRemoteAddress()

String getRemoteAddress ( )

Remote address.

§ linkState()

void linkState ( String  message,
NetworkState  state 
)

Link network state to 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. This can be changed on a per state basis.

§ new()

Connection new ( )

Create connection.

§ sendMessage()

void 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.

§ sendReliableMessage()

void 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.

§ setConnectionListener()

void setConnectionListener ( ConnectionListener  listener)

Set connection listener or null if not set.


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