What platform? Is you DNS working? DRb performs a DNS lookup to discover your local hostname.
$ cat simple_server.rb
#!/usr/bin/env ruby -w
# simple_service.rb
# A simple DRb service
# load DRb
require 'drb'
# start up the DRb service
DRb.start_service nil,
# We need the uri of the service to connect a client
puts DRb.uri
# wait for the DRb service to finish before exiting
DRb.thread.join
$ ruby -v simple_server.rb
ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0]
druby://kaa.local:58927
^Csimple_server.rb:15:in `join': Interrupt
from simple_server.rb:15
$
···
On 17 Jul 2005, at 13:52, Mark Volkmann wrote:
Should I be able to stop a drb server that ends with
> Should I be able to stop a drb server that ends with
>
> DRb.thread.join
>
> by hitting Ctrl-C?
>
> http://segment7.net/projects/ruby/drb/introduction.html says that
> should work.
> It's not working for me.
>
> Maybe there's additional code I need to add to enable that.
Shouldn't be...
What platform?
Windows XP
Is you DNS working? DRb performs a DNS lookup to
discover your local hostname.
Yes. I verified that by doing a ping from a command prompt on a known
URL. It pinged the correct IP address.
$ cat simple_server.rb
#!/usr/bin/env ruby -w
# simple_service.rb
# A simple DRb service
# load DRb
require 'drb'
# start up the DRb service
DRb.start_service nil,
# We need the uri of the service to connect a client
puts DRb.uri
# wait for the DRb service to finish before exiting
DRb.thread.join
$ ruby -v simple_server.rb
ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0]
druby://kaa.local:58927
^Csimple_server.rb:15:in `join': Interrupt
from simple_server.rb:15
I ran your code and was not able to break out with a Ctrl-c.
Could this be a Windows-specific problem?
···
On 7/17/05, Eric Hodel <drbrain@segment7.net> wrote:
On 17 Jul 2005, at 13:52, Mark Volkmann wrote:
--
R. Mark Volkmann
Partner, Object Computing, Inc.
I ran your code and was not able to break out with a Ctrl-c.
Could this be a Windows-specific problem?
I think it is -- I seem to recall being annoyed by this before.
I believe I ended up starting another thread that would do a 'gets'
or something and then kill the other threads after it saw the user
hit the keyboard.
This may also be problematic if e.g. you first hit some other key
besides enter -- I think that cause(s|d) problems.
Is you DNS working? DRb performs a DNS lookup to
discover your local hostname.
Yes. I verified that by doing a ping from a command prompt on a known
URL. It pinged the correct IP address.
You need to also verify that forward and reverse DNS for your machine are both set up.
$ cat simple_server.rb
#!/usr/bin/env ruby -w
# simple_service.rb
# A simple DRb service
# load DRb
require 'drb'
# start up the DRb service
DRb.start_service nil,
# We need the uri of the service to connect a client
puts DRb.uri
# wait for the DRb service to finish before exiting
DRb.thread.join
$ ruby -v simple_server.rb
ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0]
druby://kaa.local:58927
^Csimple_server.rb:15:in `join': Interrupt
from simple_server.rb:15
I ran your code and was not able to break out with a Ctrl-c.
Could this be a Windows-specific problem?
Did you get the druby:// line?
···
On 17 Jul 2005, at 14:51, Mark Volkmann wrote:
On 7/17/05, Eric Hodel <drbrain@segment7.net> wrote:
The example code doesn't use gets, so I think it is somewhere else.
···
On 17 Jul 2005, at 14:56, Hal Fulton wrote:
Mark Volkmann wrote:
I ran your code and was not able to break out with a Ctrl-c.
Could this be a Windows-specific problem?
I think it is -- I seem to recall being annoyed by this before.
I believe I ended up starting another thread that would do a 'gets'
or something and then kill the other threads after it saw the user
hit the keyboard.
This may also be problematic if e.g. you first hit some other key
besides enter -- I think that cause(s|d) problems.
On 7/18/05, Eric Hodel <drbrain@segment7.net> wrote:
Ctrl-Break works for me, but not Ctrl-c.
I'm at a loss then. You'd have to look inside the process and see what its stuck on.
I haven't really followed this thead, but this message prompted me to dig out some 20-year-old Turbo C code for an ancient DOS application. As I recall, ctrl-c interrupt had to be explicitly enabled.
The code I found called setcbrk(1) to enable trap on ctrl-c. Don't know if MSVC has (or requires) an equivalent.