Hello,
I’m attempting to write a small druby application which will run on our
network of Windows PCs. The application will run in the background and
allow
some methods to be used on the client PCs. This application needs to run
invisibly on the client PCs so I have installed the script as a service
using SRYANY.EXE, I first tried using the win32-service module, and
while I
could install the service properly I could not get it to start.
Now I have the script installed and it will start correctly on the
Windows
PC. Now I try and call a method via druby the client script hangs
indefinitely and the method never appears to return.
This happens even for a trivial ‘ping’ method, so I know it is not
hanging
in the method I’m calling.
Has anyone had any success in writing a druby application running as a
service on Windows? I’ve used druby extensively on Windows without
problems
before now, but I’ve never used it as a service.
My best guess is that for some reason creating the thread when running
as a
service is stalling somewhere, but that is just a guess.
Example dRuby Application:
require ‘drb/drb’
require ‘thread’
class SampleServer
def ping
“pong”
end
end
DRb.start_service(“druby://:1234”, SampleServer.new)
DRb.thread.join
<
Example dRuby Client:
require ‘drb/drb’
DRb.start_service
drb = DRbObject.new(nil, “druby://localhost:1234”)
puts drb.ping
<
If I run the server and client in console windows on the system,
everything
works as expected. Only when running as a service do the druby calls
hang
when calling the method on the druby server.
Any clues?
Thanks,