luaevent/test/testClient.lua

Sun, 10 Jun 2007 16:01:26 +0000

author
Thomas Harning Jr <harningt@gmail.com>
date
Sun, 10 Jun 2007 16:01:26 +0000
changeset 0
f2e807614be9
child 2
01b3a96ae760
permissions
-rw-r--r--

Initial commit:
* Created tree structure
* Committed current version

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

mercurial