| From | Sent On | Attachments |
|---|---|---|
| Olivier Lamy | Oct 9, 2011 7:08 am | |
| Mark Thomas | Oct 9, 2011 9:39 am | |
| Olivier Lamy | Oct 9, 2011 10:37 am | |
| Konstantin Kolinko | Oct 9, 2011 3:58 pm | |
| Olivier Lamy | Oct 14, 2011 1:27 am | |
| Henri Gomez | Oct 14, 2011 1:34 am | |
| Konstantin Kolinko | Oct 14, 2011 4:33 am | |
| Mark Thomas | Oct 14, 2011 4:35 am | |
| Olivier Lamy | Oct 14, 2011 5:40 am | |
| Konstantin Kolinko | Oct 14, 2011 5:57 am |
| Subject: | Re: Embeded Tomcat using a Connector with a random port (port 0) | |
|---|---|---|
| From: | Konstantin Kolinko (knst...@gmail.com) | |
| Date: | Oct 9, 2011 3:58:39 pm | |
| List: | org.apache.tomcat.dev | |
2011/10/9 Olivier Lamy <ola...@apache.org>:
tomcat.getConnector().setPort( 0 );
1) Look at how TomcatBaseTest assigns subsequent port numbers, starting with 8001.
2) While the proposed feature may have some usage, I think that I would want more control in what range the opened port number will be.
Just setting a "0" would not provide such control.
3) There are several Connector/Endpoint implementations in Tomcat. While java.net.ServerSocket does support port number of "0", I am not sure that APR-based implementation does allow it.
2011/10/9 Mark Thomas <mar...@apache.org>:
On 09/10/2011 15:08, Olivier Lamy wrote:
Hello, I'd like to be able to use a random port when using embedded Tomcat in unit tests to test servlets. Currently it's "locked" by a test in Connector#startInternal. Is it intentional ?
svn blame would have answered that for you.
To be specific, that was http://svn.apache.org/viewvc?view=revision&revision=1147949
Best regards, Konstantin Kolinko





