public void startServerIPTest() {
        // send broadcast and start as response listener
        if(running) 
            return;
        
        running = true;
        byte[] buffer = initCode.getBytes();
        
        try {
            start();
            
            InetAddress   in  = InetAddress.getLocalHost();  
            InetAddress[] all = InetAddress.getAllByName(in.getHostName());  
            InetAddress ret = (InetAddress)JOptionPane.showInputDialog(null, "Select own IP", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, null, all, initCode);
            byte[] ownIPBuf = ret.getAddress();
            int ownIP = 0;
            for (byte b: ownIPBuf)  {  
                ownIP = ownIP << 8 | (b & 0xFF);  
            }

            NetworkInterface networkInterface = NetworkInterface.getByInetAddress(ret);
            InterfaceAddress netI = (InterfaceAddress)JOptionPane.showInputDialog(null, "Select Interface", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, null, networkInterface.getInterfaceAddresses().toArray(), null);
            int subnetPrefix = netI.getNetworkPrefixLength();
            int subnetMask = 0;
            int networkAdr;
            if(subnetPrefix < 0) {
                String str = JOptionPane.showInputDialog("Enter Network Mask Prefix");
                Integer ii = new Integer(str);
                subnetPrefix = ii.intValue();
            }
            int nbHosts = (int)Math.pow(2, (32-subnetPrefix)) -2;
            for(int i = 0; i < 32; i++) {
                subnetMask = subnetMask << 1;
                if(i<subnetPrefix)
                    subnetMask += 1;
            }
            networkAdr = ownIP & subnetMask;
            for(int i = 1; i <= nbHosts; i++) {
                int newAdr = networkAdr+i;
                byte[] adrBuf = BigInteger.valueOf(newAdr).toByteArray();
                InetAddress adr = InetAddress.getByAddress(adrBuf);
                DatagramPacket packet = new DatagramPacket(buffer, buffer.length, adr, udpServerPortNb);
                socket.send(packet);
            }
        } catch(Exception e) {
            System.out.println(e.getMessage());
        }
        responseListenTimer = new Timer(responseWaitTime, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                stopServer();
                
            }
        });
        responseListenTimer.setRepeats(false);
        responseListenTimer.start();
    }