LitDev Extension API
LDServer
![](images/IntellisenseObject.png)
Server and Client communication between computers.
Separate programs are required for the server and client - this is for the server.
AutoMessages
![](images/IntellisenseProperty.png)
Show TextWindow connection messages when in auto mode "True" (default) or "False".
Broadcast(message)
![](images/IntellisenseMethod.png)
Send a message to all clients.
message The message may be any variable including an array.
returns A array of values "SUCCESS", "NOT_CONNECTED", "NO_CLIENT" or "FAILED" with the Client Name being the index.
ClientConnected
![](images/IntellisenseEvent.png)
Event when a client connects.
ClientDisconnected
![](images/IntellisenseEvent.png)
Event when a client disconnects.
ClientMessage
![](images/IntellisenseEvent.png)
Event when a client sends a message to the server.
Close(clientName)
![](images/IntellisenseMethod.png)
Disconnect and close (End) a client.
clientName The client name, usually Client1, Client2 etc.
A list of current clients can be obtained from the method GetClients or found from the ClientConnected event.
returns "SUCCESS", "NOT_CONNECTED", "NO_CLIENT" or "FAILED"
CloseDelay
![](images/IntellisenseProperty.png)
A delay in ms (default 100) when disconnecting to allow a message to be sent before connection closed (Stop, Disconnect and Close).
This delay should also be set for clients in LDClient.CloseDelay.
Disconnect(clientName)
![](images/IntellisenseMethod.png)
Disconnect a client.
clientName The client name, usually Client1, Client2 etc.
A list of current clients can be obtained from the method GetClients or found from the ClientConnected event.
returns "SUCCESS", "NOT_CONNECTED", "NO_CLIENT" or "FAILED"
GetClients()
![](images/IntellisenseMethod.png)
Get a list of current connected clients.
returns An array of current client names or "" for none.
IP
![](images/IntellisenseProperty.png)
The IP address of the server (it is defaulted to the current LAN IP).
If you want to use over the internet, then a web IP will be needed.
LastClient
![](images/IntellisenseProperty.png)
The last client name.
LastClientConnected
![](images/IntellisenseProperty.png)
The last client connected name.
LastClientDisconnected
![](images/IntellisenseProperty.png)
The last client disconnected name.
LastClientMessage
![](images/IntellisenseProperty.png)
The last client message.
Port
![](images/IntellisenseProperty.png)
The windows port to use (default 100).
SendMessage(clientName,message)
![](images/IntellisenseMethod.png)
Send a message to a client.
clientName The client name, usually Client1, Client2 etc.
A list of current clients can be obtained from the method GetClients or found from the ClientConnected event.
message The message may be any variable including an array.
returns "SUCCESS", "NOT_CONNECTED", "NO_CLIENT" or "FAILED"
Start(auto)
![](images/IntellisenseMethod.png)
Start the server.
auto Enable auto message passing "True" or "False".
If this is used (recommended) then all client data is passed via server to all other clients,
and no processing of send and receive events is required.
The data is updated to arrays of data (indexed by client name) that is returned from the client Update methods.
The auto option should be the same for server and all clients.
returns The current connection parameter ip:port (e.g. "192.168.1.60:100"), or "FAILED".
This is the parameter to use to connect from the client.
Stop()
![](images/IntellisenseMethod.png)
Stop the current server and close all clients.
returns "SUCCESS" or "FAILED"