<stream>

Type: <stream>

Many of the capabilities provided by operating systems that host the Mosquito Virtual Machine are easily abstracted by the use of one or two channels -- established network connections, port listeners, and the console are all abstracted in this fashion, and are loosely categorized as "streams."

A stream may have an "input" channel, and an "output" channel. An input channel is used to send information to the stream, and the output channel will contain events and data received by the stream. Not all streams will have both input and output channels -- for example, network listeners created by tcp-listen only have an output channel, which will contain streams representing new TCP/IP connections as they arrive.

One may use the input or output functions to obtain the respective channels of a stream. Using a channel write operation on a stream will cause the input channel to be utilized; the same holds true for the output write operations.

See also: input output