Link Search Menu Expand Document

Client

???

Constructor

 client = Client(url, name, client, updateStateAutomatically)

Arguments

Name Type Description
url string
name string
client Client The AlloNet client.
updateStateAutomatically boolean Whether or not the client should automatically update its state.

Returns

Nothing


Methods

Client:sendInteraction (Interaction, Function)

Send an RPC message (aka “interaction”) to another entity.

If you’re sending a “request” interaction (default), you should really listen to the callback to make sure your call succeeded.

Arguments

Name Type Description
Interaction interaction a populated Interaction struct
Function callback (interaction, body) a callback that takes the response interaction and the parsed response body.

Returns

Nothing


Client:poll (timeout_ms)

Send and receive buffered data synchronously now. Loops over all queued network messages until the queue is empty.

Arguments

Name Type Description
timeout_ms ??? how many ms to wait for incoming messages before giving up. Default 10.

Returns

Type Description
  bool whether any messages were parsed