|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.SessionedServerConnector biz.chitec.quarterback.gjsa.CBServerConnector
Class to connect a Java client to a GJSA server. Connects to a server with a Client. Sets server immideately in object connective mode if protocol families are equal and then holds the connection open.
A connection desaster listener can be hooked on, whose method connectionDesaster() is called if the connection breaks down.
For now, there are two ways to interact with the server. The simple one is to call the query() method with a query, which will return with the server's reply. The is a so-called "synchronous message".
Furthermore, it is possible to register a FreeFloatingHandler. This one gets every message that comes from the server without a special query (a free floating message).
Nested Class Summary | |
private class |
CBServerConnector.LineWakeupToggler
Background thread to send keep alive packets through the connection |
private class |
CBServerConnector.ReaderThread
Reader thread reading the data from the socket and writing them into the ThreadInterface |
Nested classes inherited from class biz.chitec.quarterback.gjsa.SessionedServerConnector |
|
Field Summary | |
protected java.io.BufferedReader |
bis
|
protected java.io.BufferedWriter |
bos
|
protected boolean |
emptyafter
|
protected int |
encryptionstrategy
|
static int |
FLOODTIME
|
protected boolean |
forcestring
|
protected java.lang.String |
host
|
protected static long |
LINETOGGLETIME
|
protected CBServerConnector.LineWakeupToggler |
lwt
|
static int |
MAXFLOODCOUNT
|
protected java.io.ObjectInputStream |
ois
|
protected java.io.ObjectOutputStream |
oos
|
protected java.lang.String |
pname
|
protected int |
port
|
protected boolean |
printerr
|
protected java.util.List |
pvp
|
protected CBServerConnector.ReaderThread |
reader
|
static int |
SLEEPTIME
|
protected java.net.Socket |
socket
|
private static int |
staticreaderno
|
protected ThreadInterface |
syncti
|
Fields inherited from class biz.chitec.quarterback.gjsa.SessionedServerConnector |
connected, connectionport, encodingmode, encrypted, mess, myscno, pcs, serverseenclientip, serverseenclientname, SOCKET_SO_TIME, sslciphers, sslfactory, transmitting |
Constructor Summary | |
CBServerConnector(java.lang.String host,
int port)
|
|
CBServerConnector(java.lang.String host,
int port,
int encstrat)
|
|
CBServerConnector(java.lang.String host,
int port,
java.lang.String pname,
java.util.List pvp)
|
|
CBServerConnector(java.lang.String host,
int port,
java.lang.String pname,
java.util.List pvp,
boolean forcestring,
boolean emptyafter)
|
|
CBServerConnector(java.lang.String xhost,
int xport,
java.lang.String xpname,
java.util.List xpvp,
boolean xforcestring,
boolean xemptyafter,
int xencstrat)
|
|
CBServerConnector(java.lang.String host,
int port,
java.lang.String pname,
java.util.List pvp,
int encstrat)
|
Method Summary | |
protected void |
closeOnDesaster()
|
protected void |
doCloseConnection()
Close the current connection |
protected void |
doOpenConnection()
opens the connection to the server. |
protected ServerEnvelope |
readEnvelope()
Read a reply from the server. |
void |
setReaderPriority(int newprio)
Readjusts the reader thread priority |
void |
setSendKeepAlive(boolean doit)
Enables and disables the session connector to/from sending keep alive packets to the server. |
protected void |
writeEnvelope(ServerEnvelope se)
Write an envelope to the server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FLOODTIME
public static final int MAXFLOODCOUNT
public static final int SLEEPTIME
protected static final long LINETOGGLETIME
private static int staticreaderno
protected java.net.Socket socket
protected CBServerConnector.ReaderThread reader
protected java.io.ObjectOutputStream oos
protected java.io.BufferedWriter bos
protected java.io.ObjectInputStream ois
protected java.io.BufferedReader bis
protected java.lang.String host
protected int port
protected java.lang.String pname
protected java.util.List pvp
protected boolean forcestring
protected boolean emptyafter
protected boolean printerr
protected CBServerConnector.LineWakeupToggler lwt
protected ThreadInterface syncti
protected int encryptionstrategy
Constructor Detail |
public CBServerConnector(java.lang.String xhost, int xport, java.lang.String xpname, java.util.List xpvp, boolean xforcestring, boolean xemptyafter, int xencstrat)
public CBServerConnector(java.lang.String host, int port, java.lang.String pname, java.util.List pvp, boolean forcestring, boolean emptyafter) throws java.io.IOException
public CBServerConnector(java.lang.String host, int port, java.lang.String pname, java.util.List pvp, int encstrat) throws java.io.IOException
public CBServerConnector(java.lang.String host, int port, java.lang.String pname, java.util.List pvp) throws java.io.IOException
public CBServerConnector(java.lang.String host, int port, int encstrat) throws java.io.IOException
public CBServerConnector(java.lang.String host, int port) throws java.io.IOException
Method Detail |
protected void doOpenConnection() throws java.io.IOException
doOpenConnection
in class SessionedServerConnector
java.io.IOException
- Description of the Exceptionpublic void setSendKeepAlive(boolean doit)
SessionedServerConnector
setSendKeepAlive
in class SessionedServerConnector
protected void doCloseConnection()
doCloseConnection
in class SessionedServerConnector
protected void closeOnDesaster()
public void setReaderPriority(int newprio)
protected void writeEnvelope(ServerEnvelope se) throws java.io.IOException
SessionedServerConnector
writeEnvelope
in class SessionedServerConnector
java.io.IOException
protected ServerEnvelope readEnvelope() throws java.io.IOException
SessionedServerConnector
readEnvelope
in class SessionedServerConnector
java.io.IOException
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |