-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() |