<div dir="ltr">Thanks so much Mariano! That works great.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 25, 2024 at 7:55 AM Mariano Montone via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>No. I discovered how to do it. Call #listeOn: after #destroy:</p>
<p>"1) Create server"<br>
server := WebServer new.<br>
server addService: '/' action: [:req | req send200Response:
'Hello, World!'].<br>
server listenOn: 3050.<br>
<br>
"2) Destroy the server"<br>
server destroy.</p>
<p>"3) Restart the server"</p>
<p>server listenOn: 3050<br>
</p>
<div>El 25/9/24 a las 09:44, Mariano Montone
escribió:<br>
</div>
<blockquote type="cite">
<p>What works for me is to detroy and then create the webserver
instance again:</p>
<p>"1) Create server (again)"<br>
server := WebServer new.<br>
server addService: '/' action: [:req | req send200Response:
'Hello, World!'].<br>
server listenOn: 3050.<br>
<br>
"2) Destroy the server"<br>
server destroy.</p>
<p><br>
</p>
<p>Evaluate 1), then 2), then 1) again. I would be nice if there
were a better way, but at least that's better than restarting
the image.</p>
<p><br>
</p>
<p> Mariano<br>
</p>
<div>El 24/9/24 a las 14:53, Mark Volkmann
via Cuis-dev escribió:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Here is a very simple use of the <font face="monospace">WebServer</font> class that can be
installed with
<div><font face="monospace">Feature require: 'WebClient'</font>.
A fileOut containing this code is attached.</div>
<div>The class name is <font face="monospace">BasicWebServer</font>
and it has the single instance variable <font face="monospace">server</font>.</div>
<div>It contains only these instance methods.</div>
<div><br>
</div>
<div><font face="monospace">initialize <br>
server := WebServer new.<br>
server addService: '/' action: [:req | req
send200Response: 'Hello, World!'].</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">start<br>
server listenOn: 3000<br clear="all">
</font>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">stop<br>
server stopListener</font><br>
</div>
<div><br>
</div>
<div>I can start the web server with:</div>
<div><br>
</div>
<div><font face="monospace">server := BasicWebServer new.</font></div>
<div><font face="monospace">server start.</font></div>
<div><br>
</div>
<div>Then I can browse localhost:3000 and see "Hello,
World!" in the web browser.</div>
<div><br>
</div>
<div>I can stop the web server with:</div>
<div><br>
</div>
<div><font face="monospace">server stop.</font></div>
<div><br>
</div>
<div>But I cannot start it again unless I restart the VM.
Can someone please explain what else I can do to enable
restarting the server without needing to restart the VM?</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif">R.
Mark Volkmann</font></div>
<div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object
Computing, Inc.</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
</blockquote>
</blockquote>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>