Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6427403

java.net.MulticastSocket.joinGroup() reports 'socket closed'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • core-libs
    • b86
    • generic
    • windows_xp

      It's possible that this bug is duplication of 6425815 (the same OS, the same diagnostic).

      see test:
      ------------
      import java.net.*;
      import java.io.*;
      import java.util.*;

      public class test10 {

          public static void main( String[] args ){
              try {
                  InetAddress lh = InetAddress.getLocalHost();
                  System.out.println( String.format( "local host is '%s':", lh ) );
                  MulticastSocket ms = new MulticastSocket( new InetSocketAddress(lh, 0) );
                  System.out.println( ms.getLocalAddress() + ":" + ms.getLocalPort() + (ms.isClosed()?" closed":" isn't closed") );
                  ms.joinGroup( InetAddress.getByName("224.80.80.80") );
              } catch( Exception x ){
                  x.printStackTrace( System.out );
              }
          }
      }
      ------------
      result:
      ------------
      Z:\tests>z:/lnks/jdk6/bin/java.exe -cp . test10
      local host is 'zv/129.159.125.21':
      /129.159.125.21:3245 isn't closed
      java.net.SocketException: Socket closed
          at java.net.PlainDatagramSocketImpl.join(Native Method)
          at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
          at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
          at test10.main(test10.java:13)
      ------------

            jccollet Jean-Christophe Collet (Inactive)
            itseytin Igor Tseytin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: