|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
soc.server.genericServer.Connection
A server connection.
| Nested Class Summary | |
(package private) class |
Connection.Putter
|
| Field Summary | |
protected boolean |
connected
|
protected java.util.Date |
connectTime
|
protected java.lang.Object |
data
the arbitrary app-specific data associated with this connection. |
protected java.lang.Exception |
error
|
protected java.lang.String |
hst
|
(package private) java.io.DataInputStream |
in
|
protected boolean |
inputConnected
|
(package private) java.io.DataOutputStream |
out
|
java.util.Vector |
outQueue
|
(package private) static int |
putters
|
(package private) static java.lang.Object |
puttersMonitor
|
java.lang.Thread |
reader
|
protected int |
remoteVersion
|
(package private) java.net.Socket |
s
|
(package private) Server |
sv
|
protected static int |
TIMEOUT_VALUE
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
(package private) |
Connection(java.net.Socket so,
Server sve)
initialize the connection data |
| Method Summary | |
boolean |
connect()
start reading from the net; called only by the server. |
void |
disconnect()
close the socket, stop the reader |
void |
disconnectSoft()
Accept no further input, allow output to drain, don't immediately close the socket. |
java.util.Date |
getConnectTime()
|
java.lang.Object |
getData()
|
java.lang.Exception |
getError()
|
int |
getVersion()
Give the version number (if known) of the remote end of this connection. |
java.lang.String |
host()
|
boolean |
isConnected()
Are we currently connected and active? |
void |
put(java.lang.String str)
Send this data over the connection. |
boolean |
putAux(java.lang.String str)
put a message on the net |
boolean |
putForReal(java.lang.String str)
Data is added aynchronously (sitting in outQueue). |
void |
run()
continuously read from the net |
void |
setData(java.lang.Object dat)
Set the data for this connection |
void |
setVersion(int version)
Set the version number of the remote end of this connection. |
| 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 |
| Field Detail |
static int putters
static java.lang.Object puttersMonitor
protected static final int TIMEOUT_VALUE
protected java.lang.Object data
java.io.DataInputStream in
java.io.DataOutputStream out
java.net.Socket s
Server sv
public java.lang.Thread reader
protected java.lang.String hst
protected int remoteVersion
protected java.lang.Exception error
protected java.util.Date connectTime
protected boolean connected
protected boolean inputConnected
disconnectSoft()public java.util.Vector outQueue
| Constructor Detail |
Connection(java.net.Socket so,
Server sve)
| Method Detail |
public java.lang.String host()
host in interface StringConnectionpublic boolean connect()
connect in interface StringConnectionpublic void run()
run in interface java.lang.Runnablepublic final void put(java.lang.String str)
outQueue
to be sent by the Putter thread.
put in interface StringConnectionstr - Data to sendpublic boolean putForReal(java.lang.String str)
outQueue).
This method is called when it's dequeued and sent over
the connection to the remote end.
str - Data to send
error)public final boolean putAux(java.lang.String str)
error)public java.lang.Object getData()
getData in interface StringConnectionpublic void setData(java.lang.Object dat)
setData in interface StringConnectiondat - The new data, or nullpublic java.lang.Exception getError()
getError in interface StringConnectionpublic java.util.Date getConnectTime()
getConnectTime in interface StringConnectionStringConnection.connect()public void disconnect()
disconnect in interface StringConnectionpublic void disconnectSoft()
isConnected() will return false, even if output is still being
sent to the other side.
disconnectSoft in interface StringConnectionpublic boolean isConnected()
isConnected in interface StringConnectionpublic int getVersion()
getVersion in interface StringConnectionpublic void setVersion(int version)
setVersion in interface StringConnectionversion - Version number, or 0 if unknown.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||