[Catalyst] Self restarting test server for Win32!

Will Hawes info at whawes.co.uk
Wed Nov 2 14:41:36 CET 2005


----- Original Message -----
From: "Kiefer, Sascha" <sk at intertivity.com>
To: 'The elegant MVC web framework' <catalyst at lists.rawmode.org>
Sent: Wed,  2 Nov 2005 11:28:38 +0000
Subject: RE: [Catalyst] Self restarting test server for Win32!


> I thought about that to.
> A simple solution would be:
> - connect to the http-server
> - setting up a command like KILL / HTTP/1.0
> On the server side, you have to check if the KILL command comes from an
> allowed IP (A mask will help here)
> and then restart.
> 
> --esskar

That's very similar to what I had in mind, although I hadn't thought about triggering the restart over HTTP.

I have set up a test script that creates two sockets in the main process - one for HTTP traffic and another listening on a different port for restart commands. I then run inside a while(1) loop monitoring the HTTP socket in the same way the current test server does, but I also check the other socket at each iteration. If it receives whatever command is designated as "restart the server" (currently a simple "1"), it closes the server sockets properly and then exits. The restart message is sent from within a forked (or not, as the case may be on Win32) process analogous to  $restarter in the current test server.

This is all working well and should be possible to incorporate in the test server.




More information about the Catalyst mailing list