2N/A/* -*- Mode: Java; tab-width: 4 -*- 2N/A * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. 2N/A * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. 2N/A * ("Apple") in consideration of your agreement to the following terms, and your 2N/A * use, installation, modification or redistribution of this Apple software 2N/A * constitutes acceptance of these terms. If you do not agree with these terms, 2N/A * please do not use, install, modify or redistribute this Apple software. 2N/A * In consideration of your agreement to abide by the following terms, and subject 2N/A * to these terms, Apple grants you a personal, non-exclusive license, under Apple's 2N/A * copyrights in this original Apple software (the "Apple Software"), to use, 2N/A * reproduce, modify and redistribute the Apple Software, with or without 2N/A * modifications, in source and/or binary forms; provided that if you redistribute 2N/A * the Apple Software in its entirety and without modifications, you must retain 2N/A * this notice and the following text and disclaimers in all such redistributions of 2N/A * the Apple Software. Neither the name, trademarks, service marks or logos of 2N/A * Apple Computer, Inc. may be used to endorse or promote products derived from the 2N/A * Apple Software without specific prior written permission from Apple. Except as 2N/A * expressly stated in this notice, no other rights or licenses, express or implied, 2N/A * are granted by Apple herein, including but not limited to any patent rights that 2N/A * may be infringed by your derivative works or by other works in which the Apple 2N/A * Software may be incorporated. 2N/A * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO 2N/A * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 2N/A * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2N/A * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 2N/A * COMBINATION WITH YOUR PRODUCTS. 2N/A * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 2N/A * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 2N/A * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2N/A * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 2N/A * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 2N/A * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 2N/A * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2N/A BrowserApp demonstrates how to use DNS-SD to browse for and resolve services. 2N/A - display resolved TXTRecord 2N/Aident "%Z%%M% %I% %E% SMI" 2N/A JPanel buttonRow = new JPanel(); 2N/A buttonRow.setLayout( new BoxLayout( buttonRow, BoxLayout.X_AXIS)); 2N/A buttonRow.add( Box.createHorizontalGlue()); 2N/A JButton connectButton = new JButton( "Don't Connect"); 2N/A buttonRow.add( connectButton); 2N/A buttonRow.add( Box.createRigidArea( new Dimension( 16, 0))); 2N/A// parent.add( buttonRow); 2N/A // handle failure here 2N/A /* The Browser invokes this callback when a service is discovered. */ 2N/A // handle failure here 2N/A /* The list contains BrowserListElem's */ 2N/A for (
int i =
0; i <
this.
size(); i++)
2N/A static // Initialize our static variables 2N/A /* The Browser invokes this callback when a service is discovered. */ 2N/A // Overridden to stuff serviceName into regType and make serviceName human-readable. 2N/A // Overridden to make serviceName human-readable. 2N/A // Convert a registration type into a human-readable string. Returns original string on no-match. 2N/A "_afpovertcp",
"Apple File Sharing",
2N/A "_http",
"World Wide Web servers",
2N/A "_daap",
"Digital Audio Access",
2N/A "_apple-sasl",
"Apple Password Servers",
2N/A "_distcc",
"Distributed Compiler nodes",
2N/A "_finger",
"Finger servers",
2N/A "_ichat",
"iChat clients",
2N/A "_presence",
"iChat AV clients",
2N/A "_ssh",
"SSH servers",
2N/A "_telnet",
"Telnet servers",
2N/A "_workstation",
"Macintosh Manager clients",
2N/A "_bootps",
"BootP servers",
2N/A "_xserveraid",
"XServe RAID devices",
2N/A "_eppc",
"Remote AppleEvents",
2N/A "_ftp",
"FTP services",
2N/A "_tftp",
"TFTP services" 2N/A /* Called when a domain is discovered. */ 2N/A // handle failure here