mDNS implementation in Java.
addAnswer
public DNSOutgoing addAnswer(DNSIncoming in,
InetAddress addr,
int port,
DNSOutgoing out,
DNSRecord rec)
throws IOException
Add an answer to a question. Deal with the case when the outgoing packet
overflows
addListener
public void addListener(javax.jmdns.impl.DNSListener listener,
DNSQuestion question)
Add a listener for a question. The listener will receive updates of
answers to the question as they arrive, or from the cache if they are
already available.
addServiceListener
public void addServiceListener(String type,
ServiceListener listener)
- addServiceListener in interface JmDNS
javax.jmdns.JmDNS.addServiceListener(java.lang.String,
javax.jmdns.ServiceListener)
advanceState
public void advanceState()
Sets the state and notifies all objects that wait on JmDNS.
getCache
public DNSCache getCache()
Return the DNSCache associated with the cache variable
getGroup
public InetAddress getGroup()
getInterface
public InetAddress getInterface()
throws IOException
- getInterface in interface JmDNS
getIoLock
public Object getIoLock()
getLastThrottleIncrement
public long getLastThrottleIncrement()
getLocalHost
public HostInfo getLocalHost()
getRandom
public static Random getRandom()
getServiceInfo
public ServiceInfo getServiceInfo(String type,
String name)
- getServiceInfo in interface JmDNS
javax.jmdns.JmDNS.getServiceInfo(java.lang.String, java.lang.String)
getServiceInfo
public ServiceInfo getServiceInfo(String type,
String name,
int timeout)
- getServiceInfo in interface JmDNS
javax.jmdns.JmDNS.getServiceInfo(java.lang.String, java.lang.String,
int)
getServiceTypes
public Map getServiceTypes()
getServices
public Map getServices()
getSocket
public MulticastSocket getSocket()
getState
public DNSState getState()
Returns the current state of this info.
getTask
public TimerTask getTask()
getThrottle
public int getThrottle()
isClosed
public boolean isClosed()
list
public ServiceInfo[] list(String type)
- list in interface JmDNS
javax.jmdns.JmDNS.list(java.lang.String)
recover
public void recover()
Recover jmdns when there is an error.
registerServiceType
public void registerServiceType(String type)
- registerServiceType in interface JmDNS
javax.jmdns.JmDNS.registerServiceType(java.lang.String)
removeListener
public void removeListener(javax.jmdns.impl.DNSListener listener)
Remove a listener from all outstanding questions. The listener will no
longer receive any updates.
removeServiceListener
public void removeServiceListener(String type,
ServiceListener listener)
- removeServiceListener in interface JmDNS
javax.jmdns.JmDNS.removeServiceListener(java.lang.String,
javax.jmdns.ServiceListener)
requestServiceInfo
public void requestServiceInfo(String type,
String name)
- requestServiceInfo in interface JmDNS
javax.jmdns.JmDNS.requestServiceInfo(java.lang.String,
java.lang.String)
requestServiceInfo
public void requestServiceInfo(String type,
String name,
int timeout)
- requestServiceInfo in interface JmDNS
javax.jmdns.JmDNS.requestServiceInfo(java.lang.String,
java.lang.String, int)
schedule
public void schedule(TimerTask task,
int delay)
send
public void send(DNSOutgoing out)
throws IOException
Send an outgoing multicast DNS message.
setClosed
public void setClosed(boolean closed)
setIoLock
public void setIoLock(Object ioLock)
setLastThrottleIncrement
public void setLastThrottleIncrement(long lastThrottleIncrement)
setPlannedAnswer
public void setPlannedAnswer(DNSIncoming plannedAnswer)
setState
public void setState(DNSState state)
setTask
public void setTask(TimerTask task)
setThrottle
public void setThrottle(int throttle)
startAnnouncer
public void startAnnouncer()
startRenewer
public void startRenewer()
toString
public String toString()
updateRecord
public void updateRecord(long now,
DNSRecord rec)
Notify all listeners that a record was updated.