$search
Classes | |
interface | Delegate |
Public Member Functions | |
abstract void | addServiceListener (String type, ServiceListener listener) |
abstract void | addServiceTypeListener (ServiceTypeListener listener) throws IOException |
abstract String | getHostName () |
abstract InetAddress | getInetAddress () throws IOException |
abstract InetAddress | getInterface () throws IOException |
abstract String | getName () |
abstract ServiceInfo | getServiceInfo (String type, String name, boolean persistent, long timeout) |
abstract ServiceInfo | getServiceInfo (String type, String name, boolean persistent) |
abstract ServiceInfo | getServiceInfo (String type, String name, long timeout) |
abstract ServiceInfo | getServiceInfo (String type, String name) |
abstract void | removeServiceListener (String type, ServiceListener listener) |
abstract void | removeServiceTypeListener (ServiceTypeListener listener) |
abstract void | requestServiceInfo (String type, String name, boolean persistent, long timeout) |
abstract void | requestServiceInfo (String type, String name, long timeout) |
abstract void | requestServiceInfo (String type, String name, boolean persistent) |
abstract void | requestServiceInfo (String type, String name) |
Static Public Member Functions | |
static JmDNS | create (final InetAddress addr, final String name) throws IOException |
static JmDNS | create (final String name) throws IOException |
static JmDNS | create (final InetAddress addr) throws IOException |
static JmDNS | create () throws IOException |
Static Public Attributes | |
static final String | VERSION = "3.4.2" |
mDNS implementation in Java.
Definition at line 20 of file JmDNS.java.
abstract void javax::jmdns::JmDNS::addServiceListener | ( | String | type, | |
ServiceListener | listener | |||
) | [pure virtual] |
Listen for services of a given type. The type has to be a fully qualified type name such as _http._tcp.local.
.
type | full qualified service type, such as _http._tcp.local. . | |
listener | listener for service updates |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::addServiceTypeListener | ( | ServiceTypeListener | listener | ) | throws IOException [pure virtual] |
Listen for service types.
listener | listener for service types |
IOException | if there is an error in the underlying protocol, such as a TCP error. |
Implemented in javax::jmdns::impl::JmDNSImpl.
static JmDNS javax::jmdns::JmDNS::create | ( | final InetAddress | addr, | |
final String | name | |||
) | throws IOException [inline, static] |
Create an instance of JmDNS and bind it to a specific network interface given its IP-address. If addr
parameter is null this method will try to resolve to a local IP address of the machine using a network discovery:
net.mdns.interface
If name
parameter is null will use the hostname. The hostname is determined by the following algorithm:
JmDNS name
or computer
if null. '.'
replace them by '-'
.local.
at the end of the name. Note: If you need to use a custom NetworkTopologyDiscovery it must be setup before any call to this method. This is done by setting up a NetworkTopologyDiscovery.Factory.ClassDelegate and installing it using NetworkTopologyDiscovery.Factory#setClassDelegate(NetworkTopologyDiscovery.Factory.ClassDelegate). This must be done before creating a JmDNS or JmmDNS instance.
addr | IP address to bind to. | |
name | name of the newly created JmDNS |
IOException | if an exception occurs during the socket creation |
Definition at line 136 of file JmDNS.java.
static JmDNS javax::jmdns::JmDNS::create | ( | final String | name | ) | throws IOException [inline, static] |
Create an instance of JmDNS.
Note: This is a convenience method. The preferred constructor is create(InetAddress, String).
Check that your platform correctly handle the default localhost IP address and the local hostname. In doubt use the explicit constructor.
This call is equivalent to create(null, name)
.
name | name of the newly created JmDNS |
IOException | if an exception occurs during the socket creation |
Definition at line 101 of file JmDNS.java.
static JmDNS javax::jmdns::JmDNS::create | ( | final InetAddress | addr | ) | throws IOException [inline, static] |
Create an instance of JmDNS and bind it to a specific network interface given its IP-address.
Note: This is a convenience method. The preferred constructor is create(InetAddress, String).
Check that your platform correctly handle the default localhost IP address and the local hostname. In doubt use the explicit constructor.
This call is equivalent to create(addr, null)
.
addr | IP address to bind to. |
IOException | if an exception occurs during the socket creation |
Definition at line 80 of file JmDNS.java.
static JmDNS javax::jmdns::JmDNS::create | ( | ) | throws IOException [inline, static] |
Create an instance of JmDNS.
Note: This is a convenience method. The preferred constructor is create(InetAddress, String).
Check that your platform correctly handle the default localhost IP address and the local hostname. In doubt use the explicit constructor.
This call is equivalent to create(null, null)
.
IOException | if an exception occurs during the socket creation |
Definition at line 59 of file JmDNS.java.
abstract String javax::jmdns::JmDNS::getHostName | ( | ) | [pure virtual] |
Return the HostName associated with this JmDNS instance. Note: May not be the same as what started. The host name is subject to negotiation.
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract InetAddress javax::jmdns::JmDNS::getInetAddress | ( | ) | throws IOException [pure virtual] |
Return the address of the interface to which this instance of JmDNS is bound.
IOException | if there is an error in the underlying protocol, such as a TCP error. |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract InetAddress javax::jmdns::JmDNS::getInterface | ( | ) | throws IOException [pure virtual] |
Return the address of the interface to which this instance of JmDNS is bound.
IOException | if there is an error in the underlying protocol, such as a TCP error. |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract String javax::jmdns::JmDNS::getName | ( | ) | [pure virtual] |
Return the name of the JmDNS instance. This is an arbitrary string that is useful for distinguishing instances.
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract ServiceInfo javax::jmdns::JmDNS::getServiceInfo | ( | String | type, | |
String | name, | |||
boolean | persistent, | |||
long | timeout | |||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block for the given timeout until updated information is received.
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 milliseconds. Typical timeout should be 5s. | |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract ServiceInfo javax::jmdns::JmDNS::getServiceInfo | ( | String | type, | |
String | name, | |||
boolean | persistent | |||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block until updated information is received.
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 . | |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract ServiceInfo javax::jmdns::JmDNS::getServiceInfo | ( | String | type, | |
String | name, | |||
long | timeout | |||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block for the given timeout until updated information is received.
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 milliseconds. Typical timeout should be 5s. |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract ServiceInfo javax::jmdns::JmDNS::getServiceInfo | ( | String | type, | |
String | name | |||
) | [pure virtual] |
Get service information. If the information is not cached, the method will block until updated information is received.
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 . |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::removeServiceListener | ( | String | type, | |
ServiceListener | listener | |||
) | [pure virtual] |
Remove listener for services of a given type.
type | full qualified service type, such as _http._tcp.local. . | |
listener | listener for service updates |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::removeServiceTypeListener | ( | ServiceTypeListener | listener | ) | [pure virtual] |
Remove listener for service types.
listener | listener for service types |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::requestServiceInfo | ( | String | type, | |
String | name, | |||
boolean | persistent, | |||
long | timeout | |||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
type | full qualified service type, such as _http._tcp.local. . | |
name | unqualified service name, such as foobar . | |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. | |
timeout | timeout in milliseconds |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::requestServiceInfo | ( | String | type, | |
String | name, | |||
long | timeout | |||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
type | full qualified service type, such as _http._tcp.local. . | |
name | unqualified service name, such as foobar . | |
timeout | timeout in milliseconds |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::requestServiceInfo | ( | String | type, | |
String | name, | |||
boolean | persistent | |||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
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 . | |
persistent | if true ServiceListener.resolveService will be called whenever new new information is received. |
Implemented in javax::jmdns::impl::JmDNSImpl.
abstract void javax::jmdns::JmDNS::requestServiceInfo | ( | String | type, | |
String | name | |||
) | [pure virtual] |
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
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 . |
Implemented in javax::jmdns::impl::JmDNSImpl.
final String javax::jmdns::JmDNS::VERSION = "3.4.2" [static] |
The version of JmDNS.
Definition at line 42 of file JmDNS.java.