Hi Nathan,
Many testcases in ServerSocketTest use port 0 to start the server then
call getLocalPort to get the actual port.

BTW, the PortManger.getNextPortsForUDP makes use of port 0 to get the
real port number. It's safer, I suggest to replace all the getNextPort
with this method in our code.

On 4/18/07, Nathan Beyer <[EMAIL PROTECTED]> wrote:
For the slow (and lazy), can you point me to one of the tests that
just uses port 0.

Thanks.

-Nathan

On 4/17/07, Tim Ellison <[EMAIL PROTECTED]> wrote:
> Ruth Cao wrote:
> > You are right, Vladimir.
> >
> > It is just because the 'port' variable is set to 8080 and on some
> > machines this port has already been occupied.  The test case will pass
> > if we use Support_PortManager.getNextPort() on my side.
>
> Please don't use the PortManager, just open port 0 and let the OS
> allocate a free port.  There are examples in the existing tests.
>
> Regards,
> Tim
>



--
Tony Wu
China Software Development Lab, IBM

Reply via email to