From: ara.t.howard@... Date: 2006-03-26T00:25:29+09:00 Subject: Re: drb over pipes On Fri, 24 Mar 2006, Reto Schuettel wrote: > I've appended an example which uses your library. It creates two pipes, > forks, connects the pipes to the stdin/stdout of the child and then execs > the ssh client. The same technique could also be used to communicate with a > child (instead of a unix/tcp socket or a simple plain pipe). IMHO that's > really nice, great work Jonathan! > > require 'drb' > require 'fdsocket' > > ctprd, ctpwr = IO.pipe > ptcrd, ptcwr = IO.pipe > > pid = fork > > unless pid > # child > ctprd.close > ptcwr.close > > $stdin.reopen( ptcrd ) > $stdout.reopen( ctpwr ) > > exec("ssh", "hostname", "./agent.rb") > > exit # child shounld't reach this point > end > > # parent > ctpwr.close > ptcrd.close > > fd_read = ctprd.fileno > fd_write = ptcwr.fileno > > # The URI to connect to > SERVER_URI="drbfd://#{fd_read},#{fd_write}" > DRb.start_service > > obj = DRbObject.new_with_uri(SERVER_URI) > > [...] i think this will fail with calls that use 'yield' or that return 'DrbUndumped' objects because they will attempt to open a connection __from__ 'hostname' to 'localhost'. this doccument details this in the ssh section http://www.rubygarden.org/ruby?DrbTutorial fyi. -a -- share your knowledge. it's a way to achieve immortality. - h.h. the 14th dali lama