RFR 8085049/9, java/net/MulticastSocket/TimeToLive.java fails intermittently with "Address already in use"

Chris Hegarty chris.hegarty at oracle.com
Fri Sep 23 09:40:06 UTC 2016


Looks good. Thanks Felix.

-Chris.

On 23/09/16 10:21, Felix Yang wrote:
> Hi there,
>
>     please review a minor test fix to avoid hard-coded port usage, which
> leads to "Address already in use" issue intermittently.
>
> Bug:
>
>     https://bugs.openjdk.java.net/browse/JDK-8085049
>
> Since it is just a 1 line change, just print the patch here:
>
> diff -r 83030d149c5c test/java/net/MulticastSocket/TimeToLive.java
> --- a/test/java/net/MulticastSocket/TimeToLive.java     Fri Sep 23
> 01:08:24 2016 +0000
> +++ b/test/java/net/MulticastSocket/TimeToLive.java     Fri Sep 23
> 01:39:24 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++) {
>
>
> Thanks,
>
> Felix
>


More information about the net-dev mailing list