JDK-6373116 : javasoft.sqe.tests.api.java.net.MulticastSocket.sendTests fails on Windows Vista
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86
  • Submitted: 2006-01-17
  • Updated: 2012-03-23
  • Resolved: 2006-02-01
Related Reports
Duplicate :  
Description
JCK            : JCK6.0 b15a
J2SE           : FAIL - mustang b67
Platform[s]    : FAIL - Windows Vista
switch/Mode    : FAIL - default

Always reproducable.

the following test (javasoft.sqe.tests.api.java.net.MulticastSocket.sendTests) fails on Windows Vista and passes on all other platforms. It seems the problem is in the native realization of method PlainDatagramSocketImpl.join then localhost interface was set.

The following code:

/* start of code */
import java.net.*;

public class net{

    public static void main(String args[]) {

    try{
	System.out.println("Creating new MulticastSocket");
        MulticastSocket soc = new MulticastSocket(0);
/**/	System.out.println("setting interface");
/**/   	soc.setInterface(InetAddress.getLocalHost());
	System.out.println("joining group");
        soc.joinGroup(InetAddress.getByName("224.80.80.80"));
	return;
	}catch(Exception e){
		e.printStackTrace();
	}
    }
}
/* end of code */

works correctly on all operational systems except Vista. On Vista it results:

Creating new MulticastSocket
setting interface
joining group
java.net.SocketException: error setting options
        at java.net.PlainDatagramSocketImpl.join(Native Method)
        at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
        at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
        at net.main(net.java:15)


But if we remove lines which are marked with /**/ test passes.

jtr is attached.