public synchronized void close() {
public void close() {
    public synchronized void close() {        if (state != DNSState.CANCELED) {                        // remove the shutdown hook            if (shutdown != null) {                Runtime.getRuntime().removeShutdownHook(shutdown);            }                        unregisterAllServices();            disposeServiceCollectors();                        // Stop JmDNS            state = DNSState.CANCELED;                        // Stop the timer            timer.cancel();                        // close socket            try {                socket.leaveGroup(group);                socket.close();            } catch (IOException e) {                // ignore            }        }    }