com.toremote.websocket.handler
Interface HandlerInterface


public interface HandlerInterface


Field Summary
static java.lang.String ARG_CLIENT_IP
           
static java.lang.String ARG_HOST
           
 
Method Summary
 void exit()
          close the output
 void onBinaryReceived(byte[] frame)
          process client side binary message.
 void onClientDisconnected()
          invoked after client is disconnected by network issue etc.
 void onHandShake(java.lang.String path, java.lang.String protocol, java.lang.String cookie)
           
 void onTextReceived(java.lang.String result)
          process client side text message
 void setOutput(com.toremote.websocket.OutputInterface output)
          setup output
 void setSessionId(java.lang.String id)
          set up session id for this session
 java.lang.String toJson()
           
 

Field Detail

ARG_CLIENT_IP

static final java.lang.String ARG_CLIENT_IP
See Also:
Constant Field Values

ARG_HOST

static final java.lang.String ARG_HOST
See Also:
Constant Field Values
Method Detail

setOutput

void setOutput(com.toremote.websocket.OutputInterface output)
setup output

Parameters:
output -
See Also:
OutputInterface

onHandShake

void onHandShake(java.lang.String path,
                 java.lang.String protocol,
                 java.lang.String cookie)
                 throws java.lang.Exception
Parameters:
path - url path
protocol - websocket protocol, not used.
cookie - cookie from client side browser
Throws:
java.lang.Exception

onTextReceived

void onTextReceived(java.lang.String result)
                    throws java.lang.Exception
process client side text message

Parameters:
result -
Throws:
java.lang.Exception

exit

void exit()
close the output


onBinaryReceived

void onBinaryReceived(byte[] frame)
                      throws java.lang.Exception
process client side binary message.

Parameters:
frame -
Throws:
java.lang.Exception

setSessionId

void setSessionId(java.lang.String id)
set up session id for this session

Parameters:
id -

toJson

java.lang.String toJson()

onClientDisconnected

void onClientDisconnected()
invoked after client is disconnected by network issue etc.