while ((b = System.in.read()) != -1 && (char) b != 'q') {
/* Stub */
}
System.out.println("Closing JmDNS...");
jmdns.unregisterService(pairservice);
jmdns.unregisterAllServices();
jmdns.close();
System.out.println("Done!");
System.exit(0);
} catch (IOException e) {
e.printStackTrace();