dofile("tcpsock.lua") local con = nil local function connect_cb(con, err) if con then printtable{"connected"} elseif err then printtable{err} end end local function disconnect_cb() printtable{"disconnected"} end local function line_cb() printtable{"got line"} end function sockettest_connect() con = TCP.make_client("localhost", 1032, connect_cb, line_cb, disconnect_cb) end function sockettest_disconnect() if con then con.tcp:Disconnect() end end