Element: channel.evaluate( )

Type

string func

Description

Evaluate a function on the peer process to which the channel is connected.
The value returned by this function will be an array of strings returned as a rsult of executing the function on the peer.

The channel must be a peer channel. For all other channels, this function is a no-op.

The following values are returned by this function:

0 - when the evaluation text was received by the peer and processed (successfully or otherwise),

-1 - when a communication error has occurred.

The code of the function cannot be redefined.

Parameters

<channel>.command(<expression> {,<sync>)

Notes

The channel timeout will be used by this function. If the peer process has not responded within the timeout period, an error will be recorded.

If execution of the expression on the peer yields values other than string values, they will be converted to strings.

Example

Open a channel to a peer, whose network socket is known, and evaluate a simple expression to get the time that the peer process started.

open ch,-peer='localhost:64346',-tim=5
unless (err) {
# Although .evaluate returns a string, we can assign strings directly to time identifiers
   time t = ch.evaluate('session_start')
   ch.close
}

See Also

Commands:

open

Identifiers:

chan# (channel)

Structures:

channel, channel.close, channel.command, channel.timeout