| java.lang.Object org.netbeans.lib.collab.util.SRVLookup
SRVLookup | public class SRVLookup (Code) | | Utility class to perform DNS lookups.
The original version of this code was contributed to the jdev mailing
list by Matt Tucker
author: Jacques Belissent |
lookup | public static InetSocketAddress lookup(String domain, String service, String transport, int defaultPort) throws IllegalArgumentException, UnknownHostException, NamingException(Code) | | Returns the host name and port of a service specified by prefix
for a given domain.
A DNS SRV lookup for a record in the form prefixdomain
is attempted.
If that lookup fails, it's assumed that the service lives at
the host resolved by a DNS Address lookup at the specified
domain on the specified default port.
As an example, a lookup for "example.com" may return
"im.example.com:5269".
Parameters: domain - the domain to resolve Parameters: prefix - DNS SRV prefix of the form service.protocol. Parameters: defaultPort - port to use if none other is specified. a SocketAddress based on the obtained host and port |
main | public static void main(String[] arg)(Code) | | Usage:
java org.netbeans.lib.collab.util.SRVLookup domain default-port [service transport]
Examples:
java org.netbeans.lib.collab.util.SRVLookup jabber.org 5269
java org.netbeans.lib.collab.util.SRVLookup jabber.org 5269 xmpp-server tcp
java org.netbeans.lib.collab.util.SRVLookup jabber.org 5222 xmpp-client tcp
|
|
|