|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
mobnet.SocketTimer
SocketTimer.java SocketTimer is used to implement timeouts when reading from a Socket
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
SocketTimer(int ms,
InputStream input)
Constructor for SocketTimer |
|
| Method Summary | |
int |
getTimeout()
|
static void |
main(java.lang.String[] args)
|
void |
resetTimer()
Reset the timer. |
void |
run()
Run method to launch timer in new thread. |
void |
setTimer(int ms)
Set the length of the timeout |
void |
startTimer()
Start the timer. |
| 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SocketTimer(int ms,
InputStream input)
ms - Length of time outinput - InputStream to which this SocketTimer is bound to| Method Detail |
public void startTimer()
throws java.net.SocketTimeoutException
java.net.SocketTimeoutExceptionpublic void resetTimer()
public void setTimer(int ms)
ms - length of timeout in millisecondspublic int getTimeout()
public void run()
public static void main(java.lang.String[] args)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||