Multicast socket, joinGroup
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abhay_Shukla
Posted On:   Sunday, November 4, 2001 01:09 AM

InetAddress group = InetAddress.getByName("127.0.0.1"); MulticastSocket msocket = new MulticastSocket(port); System.out.println("Requesting multicast group membership ...") ; msocket.joinGroup(group); System.out.println("Joined the group.") ; Here is the output I get at runtime: Requesting multicast group membership ... Exception in thread "main" java.net.SocketException: Unknown error at java.net.PlainDatagramSocketImpl.join(Native Method) at java.net.MulticastSocket.joinGroup(MulticastSocket.java:229) at TestLocalMulticast.main(TestLocalMulticast.java:23)    More>>

InetAddress group = InetAddress.getByName("127.0.0.1");

MulticastSocket msocket = new MulticastSocket(port);

System.out.println("Requesting multicast group membership ...") ;

msocket.joinGroup(group);

System.out.println("Joined the group.") ;




Here is the output I get at runtime:




Requesting multicast group membership ...

Exception in thread "main"
java.net.SocketException: Unknown error
at java.net.PlainDatagramSocketImpl.join(Native Method)

at java.net.MulticastSocket.joinGroup(MulticastSocket.java:229)

at TestLocalMulticast.main(TestLocalMulticast.java:23)





Here is the sun's documentation for Mulitcast socket's joinGroup() method

public void joinGroup(InetAddress mcastaddr) throws IOException
Joins a multicast group, with the local interface to receive multicast datagram packets chosen by the kernel.
If there is a security manager, this method first calls its checkMulticast method with the mcastaddr argument as its

argument.

Parameters:
mcastaddr - is the multicast address to join
Throws:
IOException - if there is an error joining or when the address is not a multicast address.
SecurityException - if a security manager exists and its checkMulticast method doesn't allow the join.




As there is not security or IO exception, what could be the problem? any suggestions ?

   <<Less

Re: Multicast socket, joinGroup

Posted By:   Asser_Moustafa  
Posted On:   Wednesday, December 26, 2001 12:17 PM

Your IP address is not a class D IP address (224.0.0.0 to 239.255.255.255, inclusive - with the exception of 224.0.0.0), which is something that is required by a multicast.
About | Sitemap | Contact