--- a/jdk/test/java/nio/channels/Selector/ByteServer.java Tue Jun 15 20:34:49 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/ByteServer.java Wed Jun 16 14:24:46 2010 +0100
@@ -33,7 +33,6 @@
public class ByteServer {
- public static final int PORT = 31415;
public static final String LOCALHOST = "localhost";
private int bytecount;
private Socket socket;
@@ -43,7 +42,11 @@
public ByteServer(int bytecount) throws Exception{
this.bytecount = bytecount;
- serversocket = new ServerSocket(PORT);
+ serversocket = new ServerSocket(0);
+ }
+
+ public int port() {
+ return serversocket.getLocalPort();
}
public void start() {