|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
StringConnection allows clients and servers to communicate, with no difference between local and actual networked traffic.
1.0.0 - 2007-11-18 - initial release 1.0.1 - 2008-06-28 - add getConnectTime 1.0.2 - 2008-07-30 - no change in this file 1.0.3 - 2008-08-08 - add disconnectSoft, getVersion, setVersion
| Method Summary | |
boolean |
connect()
Start ability to read from the net; called only by the server. |
void |
disconnect()
Close the socket, set EOF |
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 data over the connection. |
void |
run()
For server-side thread which reads and treats incoming messages |
void |
setData(java.lang.Object data)
Set the app-specific data for this connection. |
void |
setVersion(int version)
Set the version number of the remote end of this connection. |
| Method Detail |
public java.lang.String host()
public void put(java.lang.String str)
throws java.lang.IllegalStateException
str - Data to send
java.lang.IllegalStateException - if not yet accepted by serverpublic void run()
public boolean isConnected()
public boolean connect()
public void disconnect()
public void disconnectSoft()
isConnected() will return false, even if output is still being
sent to the other side.
public java.lang.Object getData()
public void setData(java.lang.Object data)
data - The new data, or nullpublic java.lang.Exception getError()
public java.util.Date getConnectTime()
connect()public int getVersion()
public void setVersion(int version)
version - Version number, or 0 if unknown.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||