|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.lightdev.app.ddnscl.net.DynDnsIPChecker
This class uses the web based IP detection service of www.dyndns.org to find out the IP address a machine is connected to the internet under.
This is useful, when a client connects through a router and the client can not determine the IP address under which the router connects to the internet.
The class assumes the reply to be in the format DnyDNS.org used at the time this
class was created:
Current IP Check
Current IP Address: 217.233.199.126
Important: the service at DynDNS.org has a limit of once every 10 minutes.
| Nested Class Summary | |
static interface |
DynDnsIPChecker.DynDnsIPCheckerListener
A class using a DynDnsIPChecker thread needs to implement this interface
inorder to be notified when an IP address was received |
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
DynDnsIPChecker(DynDnsIPChecker.DynDnsIPCheckerListener l)
constructor |
|
| Method Summary | |
void |
detectIPAddress()
initiate this thread, i.e. call method 'run' to connect to the given address (default is checkip.dyndns.org) and wait to receive the public IP address returned by respective address |
String |
getIP()
get the received IP |
void |
run()
run this thread, i.e. connect to the given address (default is checkip.dyndns.org) and wait until the public IP address is returned by respective address. |
void |
setRequestReceiver(String address)
set the address to request an IP check at (e.g. checkip.dyndns.org) If the address is not set explicitly with this method, the default address checkip.dyndns.org is used. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DynDnsIPChecker(DynDnsIPChecker.DynDnsIPCheckerListener l)
l - DynDnsIPCheckerListener the listener to notify when the IP was received| Method Detail |
public void setRequestReceiver(String address)
If the address is not set explicitly with this method, the default address checkip.dyndns.org is used.
address - String the address to request an IP atpublic String getIP()
public void detectIPAddress()
runpublic void run()
|
Copyright (c) 2004 Ulrich Hilger | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||