Code:
import java.net.*;
public class Test{
public static void main(String s[])throws Exception
{
MulticastSocket ms = new MulticastSocket(4000);
System.out.println(ms);
InetAddress ia = InetAddress.getByName("237.0.0.1");
//InetAddress ia = ms.getInterface();
System.out.println(ia);
ms.joinGroup(ia);
}
}
My network interface card is plugged but receive error
java.net.SocketException: Insufficient buffer space
at jrockit.net.SocketNativeIO.join(ILjava.net.InetAddress;Ljava.net.Netw
orkInterface;Z)V(Unknown Source)
at jrockit.net.SocketNativeIO.join(Ljava.io.FileDescriptor;Ljava.net.Ine
tAddress
V(Unknown Source)
at java.net.PlainDatagramSocketImpl.join(Ljava.net.InetAddress
V(Unknow
n Source)
at java.net.MulticastSocket.joinGroup(Ljava.net.InetAddress
V(Multicast
Socket.java:274)
at Test.main([Ljava.lang.String
V(Test.java:11)