@Override
    protected void receiveBroadcast(String data, InetAddress address) {
        // See if the packet holds the right message                    
        if (sr.getServerComm() != null && data.startsWith(DISCOVERY_QUESTION)) {
            broadcastServerInfo();
        } else if (sr.getServerComm() == null && data.startsWith(DISCOVERY_INFO)) {
            final String ipAndPort = data.substring(DISCOVERY_QUESTION.length() + DELIMITER.length());
            final String ipS = ipAndPort.substring(0, ipAndPort.indexOf(DELIMITER));
            final String portS = ipAndPort.substring(ipAndPort.indexOf(DELIMITER));                         
            try {
                final InetAddress ipAddr = InetAddress.getByName(ipS);

                int port;
                try {
                    port = Integer.parseInt(portS);
                } catch (NumberFormatException ex) {
                    LOG.log(Level.WARNING, "Illegal port number received - {0}", portS);
                    port = GlobalConstants.DEFAULT_PORT;
                }
                
                try {
                    sr.registerToServer(ipAddr, port);
                } catch (ConnectionException ex) {
                    LOG.warning("Error contacting server.");
                    LOG.log(Level.FINE, "Error contacting server.", ex);
                }
            } catch (UnknownHostException ex) {
                LOG.log(Level.WARNING, "Illegal server IP received - {0}", ipS);
            }
        }
    }