Code example for MulticastSocket

Methods: joinGroup

0
		//return this.packet.getData(); 
		return this.packet;
	} 
 
	public void registerForGroup(MulticastGroup group) throws IOException {
		this.socket = new MulticastSocket(group.getPort());
		groupAddr = group.getGroupAddress();
		socket.joinGroup(groupAddr);		
	} 
 
	public void unregisterFromGroup(MulticastGroup group) throws IOException {
		socket.leaveGroup(group.getGroupAddress());
		//socket.close();   
	} 
 
}