luaevent/test/testClient.lua

changeset 0
f2e807614be9
child 2
01b3a96ae760
equal deleted inserted replaced
-1:000000000000 0:f2e807614be9
1 require"luaevent"
2 require"socket"
3
4 local function func()
5 print("ACTIVATED")
6 local sock = socket.tcp()
7 --sock:
8 sock = luaevent.wrap(sock)
9 print(assert(sock:connect("localhost", 20000)))
10 for i = 1, 100000 do assert(sock:send("Greet me ")) assert(sock:receive(10)) collectgarbage() end
11 end
12
13 luaevent.addthread(func)
14
15 luaevent.loop()

mercurial