|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--com.dalsemi.tininet.dhcp.DHCPClient
The DHCPClient supports dynamically obtaining a new IP Address or reclaiming an IP Address lost on reboot from a DHCP server. Both constructors are passed a DHCPListener so that DHCP status messages can be relayed. After the DHCPClient object is constructed, the process in invoked through the start() method. When the user no longer needs the IP Address it is recommended that the stopDHCP method is called to release the IP to the server and close the socket.
Refer to the following RFCs:
951 - BOOTSTRAP PROTOCOL (BOOTP) 1048 - BOOTP Vendor Information Extensions 2131 - Dynamic Host Configuration Protocol 2132 - DHCP Options and BOOTP Vendor ExtentionsRFC repository http://www.ietf.org/rfc.html
Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
Constructor Summary | |
DHCPClient(DHCPListener DL)
Constructs a dhcp object and intializes for obtaining a new IP. |
|
DHCPClient(DHCPListener DL,
byte[] serverIP,
byte[] localIP)
Constructs a dhcp object and intializes to attempt to rebind to previous owned IP that was lost in a reboot. |
Method Summary | |
void |
addDHCPListener(DHCPListener newListener)
Adds listener for accepting dhcp status messages. |
void |
removeDHCPListener(DHCPListener thisListener)
Removes listener, to discontinue acceptance of status messages. |
void |
run()
Starts dhcp thread. |
void |
stopDHCPThread()
Stops dhcp thread, releases ip, and closes any open sockets. |
Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
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 DHCPClient(DHCPListener DL) throws java.lang.IllegalStateException
DL
- DHCPListener to report DHCP status messagesDHCPListener.java
public DHCPClient(DHCPListener DL, byte[] serverIP, byte[] localIP) throws java.lang.IllegalStateException
DL
- DHCPListenerserverIP
- IP of DHCP server where previous IP was obtainedlocalIP
- IP to obtainMethod Detail |
public void run()
public void stopDHCPThread()
public void addDHCPListener(DHCPListener newListener)
newListener
- DHCPListener for accepting status messagespublic void removeDHCPListener(DHCPListener thisListener)
thisListener
- DHCPListener to be removed from list
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |