8085049: java/net/MulticastSocket/TimeToLive.java fails intermittently with "Address already in use"
Reviewed-by: chegar
--- a/jdk/test/java/net/MulticastSocket/TimeToLive.java Fri Sep 23 01:08:24 2016 +0000
+++ b/jdk/test/java/net/MulticastSocket/TimeToLive.java Fri Sep 23 03:15:00 2016 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
static int[] bad_ttls = { -1, 256 };
public static void main(String[] args) throws Exception {
- MulticastSocket socket = new MulticastSocket(6789);
+ MulticastSocket socket = new MulticastSocket();
int ttl = socket.getTimeToLive();
System.out.println("default ttl: " + ttl);
for (int i = 0; i < new_ttls.length; i++) {