<div dir="ltr">Hey Stuart,<div><br></div><div>Thanks for getting back to me.  Filed a bug here: <a href="https://issues.jboss.org/browse/UNDERTOW-628">https://issues.jboss.org/browse/UNDERTOW-628</a></div><div><br></div><div>Any approximate ETA on the next version?<br></div><div><br></div><div>Thanks,</div><div>Oliver</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 8, 2016 at 10:25 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is not currently possible in an &#39;easy&#39; manner. You could do it manually (avoiding the Undertow object and using XNIO + the listeners directly and writing your own code to handle this) however this is probably not what you are after. If you file a JIRA I should be able to get this into the next Undertow version.<br>
<br>
Stuart<br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Oliver Dain&quot; &lt;<a href="mailto:oliver@analyticspot.com" target="_blank">oliver@analyticspot.com</a>&gt;<br>
&gt; To: <a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
&gt; Sent: Tuesday, 9 February, 2016 10:27:02 AM<br>
&gt; Subject: [undertow-dev] Let undertow pick a port<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m trying to write some unit tests with an embedded undertow server. I’d<br>
&gt; like to have the server find an open port. This makes the tests more robust<br>
&gt; in many ways. For example, tests can be run in parallel and if a socket is<br>
&gt; held in CLOSE_WAIT or something from a previous test the next test will<br>
&gt; still run and succeed. With most servers I’ve used you can pass 0 for the<br>
&gt; port and the server will find an open port. This doesn’t seem to be the case<br>
&gt; with Undertow. Even if that would work, I don&#39;t see a method like getPort()<br>
&gt; on the Undertow object so I don&#39;t know how I&#39;d discover the port to which it<br>
&gt; bound. Is this possible??<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Oliver<br>
&gt; --<br>
&gt; CTO, Analytic Spot<br>
&gt; 44 West Broadway #222<br>
&gt; Eugene, OR 97401<br>
&gt; <a href="http://analyticspot.com" rel="noreferrer" target="_blank">analyticspot.com</a> • 425-296-6556<br>
&gt; <a href="http://www.linkedin.com/in/oliverdain" rel="noreferrer" target="_blank">www.linkedin.com/in/oliverdain</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div dir="ltr"><div style="font-size:small"><div style="font-size:13px;line-height:19.5px">CTO, Analytic Spot</div><div style="font-size:13px;line-height:19.5px">44 West Broadway #222</div><div style="font-size:13px;line-height:19.5px">Eugene, OR 97401<br></div><div style="font-size:13px;line-height:19.5px"><a href="http://analyticspot.com/" style="z-index: 0;">analyticspot.com</a> <span style="color:rgb(127,127,127);font-family:&#39;helvetica neue&#39;;font-size:11px;line-height:normal">• </span>425-296-6556</div></div><div style="font-size:small"><span style="line-height:19.5px"><a href="http://www.linkedin.com/in/oliverdain" style="z-index: 0;">www.linkedin.com/in/oliverdain</a></span></div></div>