I wrote simle tcp proxy.
I have 2 fibers
Fiber1 read from backend and write to frontend
Fiber2 read from frontend and write to backend
Fiber1 create Fiber2 and pass frontend sockt.
All works. But on close all hungup.
This i think relevant example. If need i can post all proxy.
local client = luv.net.tcp()
LOG.info("connect: ", client:connect(BACKEND.host, BACKEND.port))
local fib = luv.fiber.create(function()
LOG.trace("FIBER >>>", client:read())
end):ready()
LOG.trace("MAIN >>>", client:read())
fib:join()
LOG.info("close: ", client:close()) -- !!! this block forever
this output
2013-04-12 14:51:20 [INFO] connect: userdata<luv.net.tcp>: 0093E7F8 127.0.0.1
2013-04-12 14:51:22 [TRACE] MAIN >>> some data
2013-04-12 14:51:22 [TRACE] FIBER >>> other data
I wrote simle tcp proxy. I have 2 fibers Fiber1 read from backend and write to frontend Fiber2 read from frontend and write to backend Fiber1 create Fiber2 and pass frontend sockt. All works. But on close all hungup. This i think relevant example. If need i can post all proxy.
this output
trace: