aboutsummaryrefslogtreecommitdiffstats
path: root/luaevent/test/testClient.lua
blob: b6dfa4415d7bd715be198c4babd8d00665bc52e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require"luaevent"
require"socket"

local function func()
	print("ACTIVATED")
	local sock = socket.tcp()
	--sock:
	sock = luaevent.wrap(sock)
	print(assert(sock:connect("localhost", 20000)))
	for i = 1, 100000 do assert(sock:send("Greet me  ")) assert(sock:receive(10)) collectgarbage() end
end

luaevent.addthread(func)

luaevent.loop()