All pastes #636147 Raw Edit

Anonymous

public text v1 · immutable
#636147 ·published 2007-07-27 17:35 UTC
rendered paste body
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