test/testClient.lua

changeset 17
1a093a31059d
parent 13
3e2ea1e7b2e8
equal deleted inserted replaced
16:742a6620b378 17:1a093a31059d
10 local sock = socket.tcp() 10 local sock = socket.tcp()
11 --sock: 11 --sock:
12 sock = luaevent.wrap(sock) 12 sock = luaevent.wrap(sock)
13 print(assert(sock:connect("localhost", 20000))) 13 print(assert(sock:connect("localhost", 20000)))
14 for i = 1, 100 do assert(sock:send("Greet me ")) assert(sock:receive(10)) collectgarbage() end 14 for i = 1, 100 do assert(sock:send("Greet me ")) assert(sock:receive(10)) collectgarbage() end
15 print("COMPLETE")
15 end 16 end
16 17
17 luaevent.addthread(func) 18 luaevent.addthread(func)
18 19
19 luaevent.loop() 20 luaevent.loop()

mercurial