ICI Modules: net: sktopen


Modules by name : by type

Synopsis

file = net.sktopen(socket [, string])

Description

Open a socket as a file compatible with ICI's stream I/O functions (getline, printf et al). The socket must represent a TCP connection, the string argument giving the open mode, "r" for read, "w" for write. If no access mode is given it defaults to "r" as in other ICI open functions.

Socket-based files use buffered I/O for both input and output and the underlying network protocol is assumed to be compatible with the read-aread such buffering creates. Output is collected in a 2KB buffer written when the buffer fills or upon calls to flush().