Object function reference

open

A reference entry for open

Object function · Socket

open(number port, string function) ⇒ boolean

Opens a TCP server socket on the given port and blocks while waiting for a client to connect. Once connected, it reads incoming data line-by-line and executes the provided function for each received line. Returns true if the server ran successfully, otherwise false.