Class: ROS::XMLRPCServer

Inherits:
XMLRPC::WEBrickServlet
  • Object
show all
Defined in:
lib/ros/xmlrpcserver.rb

Overview

original XMLRPC Server (remove access log)

Instance Method Summary collapse

Constructor Details

#initialize(port = 8080, host = "127.0.0.1", maxConnections = 100, stdlog = "#{ENV['HOME']}/.ros/log/rosruby.log") ⇒ XMLRPCServer

Returns a new instance of XMLRPCServer.



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

def initialize(port=8080,
               host="127.0.0.1",
               maxConnections=100,
               stdlog="#{ENV['HOME']}/.ros/log/rosruby.log")
  super({})
  require 'webrick'
  @server = WEBrick::HTTPServer.new(:Port => port, 
                                    :BindAddress => host,
                                    :MaxClients => maxConnections,
                                    :Logger => WEBrick::Log.new(stdlog),
                                    :AccessLog => [])
  @server.mount("/", self)
end

Instance Method Details

#serveObject



31
32
33
# File 'lib/ros/xmlrpcserver.rb', line 31

def serve
  @server.start
end

#shutdownObject



35
36
37
# File 'lib/ros/xmlrpcserver.rb', line 35

def shutdown
  @server.shutdown
end