[undertow-dev] start listener on random port

Sascha Sadat-Guscheh kid at bitkid.com
Tue Nov 29 08:03:51 EST 2016


hello undertow developers!

is there a way to start a http listener on a random free port? i have a test suite that runs multithreaded so each untertow server uses a random port, that i get like this:

new ServerSocket(0).getLocalPort()

sometimes i run into a race condition when a different process grabs the port before undertow listens on it.  so a possible solution would be to just let undertow assign the port, and then ask it what port its listening on. (or pass the socket instead of the port number to undertow)

is that a worthwile feature? should i try to submit a pr that does that? or is it already possible?

thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.jboss.org/pipermail/undertow-dev/attachments/20161129/5ae04e8c/attachment.bin 


More information about the undertow-dev mailing list