Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > WEBrick::Daemon and WEBrick

Reply
Thread Tools

WEBrick::Daemon and WEBrick

 
 
Aaron Smith
Guest
Posts: n/a
 
      03-09-2007
Is it possible to use the WEBrick:aemon with WEBrick::AbstractServlet.
Here is what i'm running for the basic servlet:

dir = Dir:wd
server = WEBrick::HTTPServer.new(
ort => port,
ocumentRoot => dir
end

server.mount "/gateway", RUBYAMF::WEBrickServlet
trap "INT" do server.shutdown end
server.start

I've seen an example saying you have to subclass the HTTPServer and just
run the WEBrick:aemon.start when initializing. But can this be done
with servlets?

Thanks.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      03-18-2007
On Mar 9, 2007, at 14:08, Aaron Smith wrote:
> Is it possible to use the WEBrick:aemon with
> WEBrick::AbstractServlet.
> Here is what i'm running for the basic servlet:
>
> dir = Dir:wd
> server = WEBrick::HTTPServer.new(
> ort => port,
> ocumentRoot => dir
> end
>
> server.mount "/gateway", RUBYAMF::WEBrickServlet
> trap "INT" do server.shutdown end
> server.start
>
> I've seen an example saying you have to subclass the HTTPServer and
> just
> run the WEBrick:aemon.start when initializing. But can this be done
> with servlets?


Servlets run in a server, so daemonize after you've started the
HTTPServer and mounted your servlets.

 
Reply With Quote
 
 
 
 
Aaron Smith
Guest
Posts: n/a
 
      03-18-2007
Eric Hodel wrote:
> On Mar 9, 2007, at 14:08, Aaron Smith wrote:
>> server.mount "/gateway", RUBYAMF::WEBrickServlet
>> trap "INT" do server.shutdown end
>> server.start
>>
>> I've seen an example saying you have to subclass the HTTPServer and
>> just
>> run the WEBrick:aemon.start when initializing. But can this be done
>> with servlets?

>
> Servlets run in a server, so daemonize after you've started the
> HTTPServer and mounted your servlets.


I figured it out actually:

server = WEBrick::HTTPServer.new(
ort => OPTIONS[ort],
ocumentRoot => OPTIONS[:working_dir],
:ServerType => OPTIONS[:server_type],
:BindAddress => OPTIONS[:ip]
)


server type is either WEBrick:aemon of WEBrick::SimpleServer

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WEBrick: Has anyone used WEBrick::Session? Lloyd Zusman Ruby 2 02-21-2013 06:49 PM
WeBrick and Windows CGI BUGS walter@mwsewall.com Ruby 1 09-23-2003 03:29 PM
webrick and ruby ahoward Ruby 7 09-11-2003 06:49 PM
WEBrick and mod_ruby performance Jeff Mitchell Ruby 14 09-10-2003 11:00 PM
Webrick and CGI question Mark Wilson Ruby 1 08-27-2003 05:25 AM



Advertisments