btv.socket
socket:write(data)
Send raw bytes over the connection (a string, or a list of strings concatenated). A no-op once the connection has closed.
Defined in process.lua.
socket:close()
Close the connection (its on_close still fires).
Defined in process.lua.
btv.socket.connect(spec)
btv.socket.connect { host, port, on_connect, on_data, on_close } -> handle. Opens a
TCP client connection and returns a handle with :write(data) and :close(). The
callbacks fire on the editor thread: on_connect() once connected, on_data(chunk)
per raw inbound batch, on_close(err) exactly once (err set on a connect/I-O
failure).
Defined in process.lua.