From: Sean Slavik Date: 2012-09-07T01:03:48+09:00 Subject: Passing Sockets (or other FDs) to target of Exec() I've been playing around with an issue that is giving me a bit of a headache and I'm hoping someone can point me in a more useful direction... On a standard startup, I have two variables: $nCS = TCPServer.new(HOST, PORT) $connected = Array.new As users connect to $nCS and login, their connection (and user data) is passed to $connected. I have a command that triggers a function "copyover" that is intended to hot-reboot the server, hopefully maintaining the connections. While I've tried writing the connections to a file and reloading them that way, the closest I seem to have gotten is the following: exec "./main.rb", "--copyover", *$nCS, *$connected Then passing: $nCS = ARGV[1] $connected = ARGV[2] Since Exec replaces the process, it should maintain the files until the process is destroyed, correct? However, this still tells me "ERROR: Caught error in Client Thread: Socket is not connected" Can anyone point me in the right direction on this? I'm stumped! -- Posted via http://www.ruby-forum.com/.