hiiiiii friends
Can anyone say me what is the error in this code
import java.net.*;
public class MulticastChatServer
{
public static void main(String[] args)
{
throws Exception //error is here "Illegal start of
expression.and ";" is needed
{
int portnumber = 1236;
if (args.length >= 1)
{
portnumber = Integer.parseInt(args[0]);
}
MulticastSocket serverMulticastSocket =new
MulticastSocket(portnumber);
System.out.println("MulticastSocket is created at port
"+portnumber);
InetAddress group=InetAddress.getByName("224.0.0.1");
serverMulticastSocket.joinGroup(group);
System.out.println("joinGroup method is called...");
boolean infinite = true;
while(infinite)
{
byte buf[] = new byte[1024];
DatagramPacket data =new DatagramPacket(buf, buf.length);
serverMulticastSocket.receive(data);
String msg =new String(data.getData()).trim();
System.out.println("Message received from client = " +
msg);
}
serverMulticastSocket.close();
}
}
}
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---