Code example for MulticastSocket

Methods: joinGroup, setSoTimeout

0
 
    /** The socket we're using to receive packets on. */ 
    private final MulticastSocket socket;
 
    public ThreadLanServerFind(LanServerList par1LanServerList) throws IOException
    { 
        super("LanServerDetector"); 
        this.localServerList = par1LanServerList;
        this.setDaemon(true);
        this.socket = new MulticastSocket(4445);
        this.broadcastAddress = InetAddress.getByName("224.0.2.60");
        this.socket.setSoTimeout(5000);
        this.socket.joinGroup(this.broadcastAddress);
    } 
 
    public void run() 
    { 
        byte[] abyte = new byte[1024];
 
        while (!this.isInterrupted())
        {