Class: RubyProxy::DRbServer

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_proxy/server.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.ipObject

Returns the value of attribute ip.



14
15
16
# File 'lib/ruby_proxy/server.rb', line 14

def ip
  @ip
end

.portObject

Returns the value of attribute port.



14
15
16
# File 'lib/ruby_proxy/server.rb', line 14

def port
  @port
end

Class Method Details

.start_serviceObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ruby_proxy/server.rb', line 17

def self.start_service
  DRb.install_id_conv(DRb::TimerIdConv.new)
  DRb.start_service("druby://#{ip}:#{port}",Proxy)
  #~ trap("INT") { DRb.stop_service }
  # for ruby1.9
  begin
    DRb.thread.join
  rescue Interrupt
  ensure
    DRb.stop_service
  end
end

.stop_serviceObject



30
31
32
# File 'lib/ruby_proxy/server.rb', line 30

def self.stop_service
  DRb.stop_service
end