recv [-eol] [-peek] [-timeout <ms>] [-status <status_varname>] [numChars] <connection> [varname]
bytes) from a sideband connection. If
is specified, the response is stored in that variable, and
returns the amount of data received. Otherwise,
- -timeout ms specifies the amount of time to wait for the data to be received. If unspecified, the default is an immediate timeout, and likely not what you want in a typical situation.
<varname> is the name of the variable in which to store the received data. If specified,
will return the number of bytes received. If unspecified,
recvwill return the received data.
- -eol causes the command to suspend until an end-of-line has been received or the timeout expires. The first line of data will be returned.
-peek will return the data received, but will leave it buffered for a subsequent call to
If -status status_varname is used, the status of the connection attempt is saved to
. These are the possible return values for the recv status:
- received - Got the requested amount of data
- closed - the connection was closed. Some data may have been received.
- timeout - A timeout occurred. Some data may have been received.
- failed - An unexpected error occurred