1 local luaevent
= require("luaevent")
2 local socket
= require("socket")
11 local sock
= socket
.tcp()
13 sock
= luaevent
.wrap(sock
)
14 print(assert(sock
:connect("localhost", 20000)))
15 for i
= 1, 100 do assert(sock
:send("Greet me ")) assert(sock
:receive(10)) collectgarbage() end
19 luaevent
.addthread(func
)