<?xml version="1.0" encoding="windows-1252"?>
<node id="647442" title="Stopping an HTTP::Server::Simple server" created="2007-10-26 13:30:24" updated="2007-10-26 09:30:24">
<type id="115">
perlquestion</type>
<author id="25823">
jaldhar</author>
<data>
<field name="doctext">
&lt;p&gt;For a web application, I'm trying to use [cpan://CGI::Application::Server], a subclass of [cpan://HTTP::Server::Simple] in my modules' tests.  So I want to create a server, do the tests and then destroy it when I've finished the tests.  The creating is straightforward but how do I say "ok stop now."&lt;/p&gt;
&lt;p&gt;Also is there a way to say "start on a guaranteed unused port"?  Right now as a workaround, I start at 9323, if the server doesn't start then I add 1 and try again and so on until I get to 9330 when I bail out completely but this doesn't seem to elegant.&lt;/p&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-25823"&gt;
&lt;p&gt;-- &lt;br&gt;&amp;#2716;&amp;#2738;&amp;#2727;&amp;#2736;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
