[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Luv - Thermonuclear battery pack for Lua
- From: Harley Laue <losinggeneration@...>
- Date: Tue, 9 Oct 2012 17:21:25 -0500
Ok, now that issue #6 is fixed (upstream) I feel a bit more confident
when playing around with it.
Here's how I wrote the echo client counterpart to tcp_echosrv.lua
-- Begin code
local luv = require('luv')
local client = luv.net.tcp()
client:connect('127.0.0.1', 8080)
while true do
local msg = luv.stdin:read()
client:write(msg)
print(client:read())
end
client:close()
-- End code
I guess how would you write this if you were doing it. It seems simple
enough that there wouldn't be any huge changes. Anyways, from the
little I've looked at it, Luv looks like it'll be fun to play with.