File psock.lua

Module to emulate the old psock library on top of luasoocket: line oriented client sockets.

Functions

connect (host, port, verbose) Creates and connect a socket.


Functions

connect (host, port, verbose)
Creates and connect a socket.

Parameters

  • host: string The host you want to connect to.
  • port: number The port you want to connect to.
  • verbose: bool True to log every message.

Return value:

userdata The socket object, or nil on failure; the returned object has a send(s) method that sends s.."\r\n" and returns a positive number on success; and a recv method, returning a string with '\r\n' stripped on success or nil on filure.

Valid XHTML 1.0!