public abstract class JmDNS extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
VERSION
The version of JmDNS.
|
| Constructor and Description |
|---|
JmDNS() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addServiceListener(String type,
ServiceListener listener)
Listen for services of a given type.
|
abstract void |
addServiceTypeListener(ServiceTypeListener listener)
Listen for service types.
|
abstract void |
close()
Close down jmdns.
|
static JmDNS |
create()
Create an instance of JmDNS.
|
static JmDNS |
create(InetAddress addr)
Create an instance of JmDNS and bind it to a
specific network interface given its IP-address.
|
abstract String |
getHostName()
Return the HostName associated with this JmDNS instance.
|
abstract InetAddress |
getInterface()
Return the address of the interface to which this instance of JmDNS is
bound.
|
abstract ServiceInfo |
getServiceInfo(String type,
String name)
Get service information.
|
abstract ServiceInfo |
getServiceInfo(String type,
String name,
int timeout)
Get service information.
|
abstract ServiceInfo[] |
list(String type)
Returns a list of service infos of the specified type.
|
abstract void |
printServices()
List Services and serviceTypes.
|
abstract void |
registerService(ServiceInfo info)
Register a service.
|
abstract void |
registerServiceType(String type)
Register a service type.
|
abstract void |
removeServiceListener(String type,
ServiceListener listener)
Remove listener for services of a given type.
|
abstract void |
removeServiceTypeListener(ServiceTypeListener listener)
Remove listener for service types.
|
abstract void |
requestServiceInfo(String type,
String name)
Request service information.
|
abstract void |
requestServiceInfo(String type,
String name,
int timeout)
Request service information.
|
abstract void |
unregisterAllServices()
Unregister all services.
|
abstract void |
unregisterService(ServiceInfo info)
Unregister a service.
|
public static String VERSION
public static JmDNS create() throws IOException
IOExceptionpublic static JmDNS create(InetAddress addr) throws IOException
IOExceptionpublic abstract String getHostName()
public abstract InetAddress getInterface() throws IOException
IOExceptionpublic abstract ServiceInfo getServiceInfo(String type, String name)
Usage note: Do not call this method from the AWT event dispatcher thread. You will make the user interface unresponsive.
type - fully qualified service type, such as _http._tcp.local. .name - unqualified service name, such as foobar .public abstract ServiceInfo getServiceInfo(String type, String name, int timeout)
Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.
type - full qualified service type, such as _http._tcp.local. .name - unqualified service name, such as foobar .timeout - timeout in millisecondspublic abstract void requestServiceInfo(String type, String name)
Usage note: Do not call this method from the AWT event dispatcher thread. You will make the user interface unresponsive.
type - full qualified service type, such as _http._tcp.local. .name - unqualified service name, such as foobar .public abstract void requestServiceInfo(String type, String name, int timeout)
type - full qualified service type, such as _http._tcp.local. .name - unqualified service name, such as foobar .timeout - timeout in millisecondspublic abstract void addServiceTypeListener(ServiceTypeListener listener) throws IOException
listener - listener for service typesIOExceptionpublic abstract void removeServiceTypeListener(ServiceTypeListener listener)
listener - listener for service typespublic abstract void addServiceListener(String type, ServiceListener listener)
_http._tcp.local..type - full qualified service type, such as _http._tcp.local..listener - listener for service updatespublic abstract void removeServiceListener(String type, ServiceListener listener)
listener - listener for service updatespublic abstract void registerService(ServiceInfo info) throws IOException
IOExceptionpublic abstract void unregisterService(ServiceInfo info)
public abstract void unregisterAllServices()
public abstract void registerServiceType(String type)
public abstract void close()
public abstract void printServices()
public abstract ServiceInfo[] list(String type)
type - Service type name, such as _http._tcp.local..Copyright © 2020 Eclipse Foundation. All rights reserved.