harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject Re: [classlib] Intermittent failures of UDP tests
Date Tue, 13 Feb 2007 22:00:59 GMT
On Tuesday 13 February 2007 21:59 Mikhail Markov wrote:
> > I don't quite get it. Is it operating system to be blamed or the code
> > for ServerSocket(0) which returns a port that is still used by some
> socket?
> No, the code for obtaining the available port is the following (
> tests.support.Support_PortManager):
>     ServerSocket ss = new ServerSocket(0);
>     int port = ss.getLocalPort();
>     ss.close();
>     return port;
> It works ok: creates a ServerSocket on a not-busy port, but when we try to
> use this port number somewhere in the test for creating a new Sockets, we
> get the mentioned "Address already in use" exception. Seems like the
> ServerSocket is not fully closed at the moment we're trying to use the
> generated port.

I just don't understand it why creating a socket on a non-busy port as you say 
results in an exception that it is actually still busy. Does this test behave 
in the same way on RI?


View raw message