|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClientPacketHandler
Inteface for packet handling clients [CHECK]
Method Summary | |
---|---|
boolean |
equalsSessionID(java.lang.String sessionID)
Returns true if the specified session ID matches the current session ID |
void |
forceCloseTCPSession()
forces the client TCP session to close |
int |
getActualPacketLength(byte[] packet,
int packetLen)
Return actual packet length based on this partial packet |
byte[] |
getFinalPacket(boolean hasError)
Return final response to the session before it closes |
byte[] |
getHandlePacket(byte[] cmd)
Process packet and return response |
byte[] |
getInitialPacket()
Return initial response to the open session |
int |
getMaximumPacketLength()
Gets the maximum packet length |
int |
getMinimumPacketLength()
Gets the minimum packet length |
boolean |
getPromptEnabled()
Gets the prompt enabled state |
int |
getResponsePort()
Return the port for UDP Datagram responses |
ServerSocketThread.SessionInfo |
getSessionInfo()
Gets a reference to the ClientPacketHandler's session info implementation |
boolean |
getTerminateSession()
Indicates if the session should terminate |
void |
idleTimeoutInterrupt()
Callback: timeout interrupt Called periodically during an idle read. |
void |
sessionStarted(java.net.InetAddress inetAddr,
boolean isTCP,
boolean isText)
Called when new client session initiated |
void |
sessionTerminated(java.lang.Throwable err,
long readCount,
long writeCount)
Called after client session terminated |
void |
setPromptEnabled(boolean enable)
Sets the prompt enabled state |
void |
setSessionInfo(ServerSocketThread.SessionInfo sessionInfo)
Sets the session info handler |
void |
setTerminateSession()
Sets the session termination state (a hint to the session thread that the session should be terminated) |
boolean |
tcpWrite(byte[] data)
Write bytes to TCP output stream asynchronously Instended to be called from a separate thread wishing to write a command asynchronously to the active device session. |
boolean |
terminateSession()
|
Method Detail |
---|
void sessionStarted(java.net.InetAddress inetAddr, boolean isTCP, boolean isText)
inetAddr
- The host IP addressisTCP
- True if the connection is TCPisText
- True if the connection is textvoid sessionTerminated(java.lang.Throwable err, long readCount, long writeCount)
err
- readCount
- writeCount
- boolean equalsSessionID(java.lang.String sessionID)
sessionID
- The session ID to test (specifying null should always return false)
void setSessionInfo(ServerSocketThread.SessionInfo sessionInfo)
sessionInfo
- An implementation of the ServerSocketThread.SessionInfo interfaceServerSocketThread.SessionInfo getSessionInfo()
byte[] getInitialPacket() throws java.lang.Exception
java.lang.Exception
byte[] getFinalPacket(boolean hasError) throws java.lang.Exception
java.lang.Exception
int getMinimumPacketLength()
int getMaximumPacketLength()
void setPromptEnabled(boolean enable)
enable
- True to enable prompt, false to disableboolean getPromptEnabled()
void idleTimeoutInterrupt()
ServerSocketThread.setMinimuTimeoutIntervalMS
"
int getActualPacketLength(byte[] packet, int packetLen)
byte[] getHandlePacket(byte[] cmd) throws java.lang.Exception
cmd
- The packet
java.lang.Exception
boolean tcpWrite(byte[] data)
data
- The data bytes to write
int getResponsePort()
void forceCloseTCPSession()
void setTerminateSession()
boolean getTerminateSession()
boolean terminateSession()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |