is it possible to pass tcp session via pipes to forked ruby process ? here is the code i am trying
and it seems to not work (browser keeps waiting for response but response never comes)
code ->
require 'socket'
server = TCPServer.new "0.0.0.0" , 5678
reader , writer = IO.pipe
fork do
loop do
session = reader.read
session.puts "Hello world! The time is #{Time.now}"
puts server.class
session.close
end
end
while session = server.accept
writer.write session
end