Back


The Linguist network package

These are the keywords supplied for network operations.

add Add a client or service
client Declare a client variable.
close Close a socket.
connection Declare an HTTP connection variable.
create Create a new client or service.
message Declare a message variable.
on Handle a network event.
open Open a socket.
post Invoke a POST on a connection.
read Read from a socket.
reply Reply to a message or a socket.
send Send a message to a client or service.
service Declare a service variable.
set Set an attribute of a connection.
socket Declare a TCP/IP socket variable.
start Start the watchdog.
update Update a client.
write Write to a socket.

Numeric and
String values
Conditional expressions


Numeric and String Values

These values can be used in a numeric or string expression:

<socket>
Returns the next byte received from the socket named. Only use this inside an on <socket> callback.

<connection>
Returns the next line of text received from the connection named. Only use this inside an on <connection> callback.

ask <message>
Send this message and returns the reply. If no reply is sent the command times out after two seconds.

the service count of <client>
When a notification is received, this returns the number of services available of the same type as this client.

the name/address of service <n> of <client>
When a notification is received, a number of services may available of the same type as this client. This command returns data about one of them, where <n> starts at zero and goes to one less than the number returned by the service count of <client>.

the name/address/text of the message
When a tell or ask message is received, this command returns the name of the sender, the address of the sender or the text of the message.

the name/address of <message> source/destination
Returns the name or address of the source or destination of this message.

the text of <message>
Returns the text of this message.

the name/address of the sender
Returns the name or address of the sender of the current message. Use inside an on tell or on ask callback.

Return to top


Conditional Expressions

The network package recognizes the following conditional expressions, which may be used in an if or while command:

<socket> has data
Returns true if the named socket has received data.

<socket> has error
Returns true if the named socket encountered an error on its last operation.

<message> has error
Returns true if the named message encountered an error on its last operation.

<client> has services
Returns true if the named client has one or more services in its last notification.

the source/destination of <message> is [not] the sender
Returns true if the source or destination of the named message is (or is not) the sender of the last message.

Return to top


Back