3 local function setupHook(thread
)
4 if not thread
then debug
.sethook(function(event
) print("TRACE >: ", debug
.getinfo(2, 'n').name
) end, 'c')
5 else debug
.sethook(thread
, function(event
) print("TRACE ", thread
,">: ", debug
.getinfo(2, 'n').name
) end, 'c') end
8 local function func(sock
)
9 sock
= luaevent
.wrap(sock
)
10 assert(sock
:connect("localhost", 20000))
14 assert(sock
:send("Greet me "))
16 assert(sock
:receive(10 * maxZ
))
18 if skt
then skt
:close() end
21 --local sock = assert(socket.tcp())
22 --luaevent.addthread(sock, func, sock)
26 local sock
= assert(socket
.tcp())
27 luaevent
.addthread(sock
, func
, sock
)