|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.TimerTask soc.server.genericServer.Server.ConnExcepDelayedPrintTask
protected class Server.ConnExcepDelayedPrintTask
This object represents one client-connect or disconnect
debug-print announcement within Server.cliConnDisconPrintsPending
.
When a client is removed
due to an error, the error message print is delayed briefly, in case the client
is doing a disconnect/reconnect (as some robot clients do).
This gives the server a chance to suppress the 2 left/rejoined messages if the
client quickly reconnects.
It's up to the server application (extending this generic Server) to recognize
that the arrived client is the same as the departed one, and remove both
messages from the pending vector. This is typically done via the client's username
or nickname, as stored in StringConnection.getData()
.
Server.addConnection(StringConnection).
,
Server.CLI_DISCON_PRINT_TIMER_FIRE_MS
Field Summary | |
---|---|
StringConnection |
arrivingConn
Key for Server.cliConnDisconPrintsPending ; null unless isArriveNotDepart |
java.lang.Object |
connData
Key for Server.cliConnDisconPrintsPending ;
non-null unless isArriveNotDepart; if so,
connection name from StringConnection.getData() |
java.lang.String |
connHost
|
java.lang.Throwable |
excep
may be null |
boolean |
isArriveNotDepart
Arrival, not a departure |
long |
thrownAt
Time at which this message was constructed, via System.currentTimeMillis() |
Constructor Summary | |
---|---|
Server.ConnExcepDelayedPrintTask(boolean isArrival,
java.lang.Throwable ex,
StringConnection c)
Create a new delayed print. |
Method Summary | |
---|---|
void |
run()
Debug-print connection's arrival or departure, and remove from pending list. |
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.Throwable excep
public java.lang.Object connData
Server.cliConnDisconPrintsPending
;
non-null unless isArriveNotDepart; if so,
connection name from StringConnection.getData()
public java.lang.String connHost
StringConnection.host()
public boolean isArriveNotDepart
public StringConnection arrivingConn
Server.cliConnDisconPrintsPending
; null unless isArriveNotDepart
public long thrownAt
System.currentTimeMillis()
Constructor Detail |
---|
public Server.ConnExcepDelayedPrintTask(boolean isArrival, java.lang.Throwable ex, StringConnection c) throws java.lang.IllegalArgumentException
isArrival
- Is this an arriving, not departing, connection?
Store connection data only if true.ex
- Exception to print after the delay; may be nullc
- Connection being disconnected; may not be null,
and unless isArrival,
c.getData()
may not be null.
java.lang.IllegalArgumentException
- if c or c.getData is nullD.ebugIsEnabled()
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |