|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectThincHandler
ThincMsgHandler
public final class ThincMsgHandler
handles the general frame buffer / video / cursor / init messages from/to the server. it recoginizes the message's type, flag and length then pass them into the proper message object. Moreover, it also takes the control from client messages to send a message. in case of init_reply messages, it pass them into ThincMsgInitReplyHandler
object to process it.
ThincHandler
Field Summary | |
---|---|
private byte |
flag
|
protected java.nio.ByteBuffer |
hd
|
private ThincMsgInitReplyHandler |
initHandler
|
private short |
length
|
static int |
MAX_MESSAGE_TYPE
|
private ThincSMsg[] |
serverMessage
|
private byte |
type
|
Fields inherited from class ThincHandler |
---|
canvas, client, clientAppData, clientPacData, isSSL, lastSent, MAX_DIRECT_ALLOCATE, rcvResult, recv, sc, send, serverAppData, serverPacData, sslEngine, sslSocket, THINC_HEADERSIZE |
Constructor Summary | |
---|---|
ThincMsgHandler(ThincClient tc,
ThincClientCanvas c)
create ThincMsgHandler object |
Method Summary | |
---|---|
int |
getFlag()
|
ThincMsgInitReplyHandler |
getInitHandler()
|
int |
getLength()
|
protected java.nio.channels.SocketChannel |
getSocketChannel()
|
void |
init()
init() receives version information from the server. try to compare the version then send client version information to the server it uses recvBytes() and sendBytes() methods because version information exchange should not have any general thinc header. |
private void |
initServerMessage()
initServerMessage() registers server message into array named serverMessage. when reply from server comes, the handler automatically choose the proper message and pass the control to it. if you want to add another server message, you can register the message by adding the line of here. |
int |
send(ThincCMsg c)
send() overriden to save last sent messages. |
void |
setSSL()
setSSL() sets ThincMsgInitReplyHandler object as
SSL secured handler. |
void |
start()
start() actually starts to receive message from server. if it comes, this parses general thinc header and pass the control to the proper server message class. |
Methods inherited from class ThincHandler |
---|
closeSocketChannel, createSocketChannel, getLastSent, getMessage, recvBytes, sendBytes, setSSLSocketChannel, SSLHandshake |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_MESSAGE_TYPE
protected java.nio.ByteBuffer hd
private ThincMsgInitReplyHandler initHandler
private ThincSMsg[] serverMessage
private byte type
private byte flag
private short length
Constructor Detail |
---|
public ThincMsgHandler(ThincClient tc, ThincClientCanvas c) throws ThincException
ThincMsgHandler
object
tc
- ThincClient
object which invokes thisc
- ThincClientCanvas
object to draw
ThincException
Method Detail |
---|
private void initServerMessage()
public void init() throws ThincException
ThincException
public void start() throws ThincException
ThincException
public int send(ThincCMsg c) throws ThincException
send
in class ThincHandler
c
- ThincCMsg
classes to send
ThincException
ThincHandler
public void setSSL()
ThincMsgInitReplyHandler
object as
SSL secured handler.
public ThincMsgInitReplyHandler getInitHandler()
protected java.nio.channels.SocketChannel getSocketChannel()
public int getFlag()
public int getLength()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |