Sat, 01 Sep 2007 00:24:11 -0400
Refactored luaevent.lua (unlearned borked fairness, collapsing useless code).
luaevent.lua:
* Unlearned fairness since it was likely to be broken...
fairness will need to be implemented at app-level where it should be.
* Collapsed duplicate code into a local function
testClient.lua:
* Added a completion message (since the test was so quick I thought it was broken)
require"luaevent" require"socket" local oldPrint = print print = function(...) oldPrint("CLT", ...) end local function func() print("ACTIVATED") local sock = socket.tcp() --sock: sock = luaevent.wrap(sock) print(assert(sock:connect("localhost", 20000))) for i = 1, 100 do assert(sock:send("Greet me ")) assert(sock:receive(10)) collectgarbage() end print("COMPLETE") end luaevent.addthread(func) luaevent.loop()