The first two are self contained so, I can probably do that. Can you describe the process using git/github, I've never used it before. I'm used to Subversion and Mercurial.
As for the third one, that requires the new message encoding. The new message encoding format is "~<opcode>~<size>~<message>". The opcodes are:
1 - Session ID (only from server to client, must be first message received by client.)
2 - Heartbeat interval (Only from server to client.)
3 - Close message (Indicates that the sender has no more messages to send and that the receiver should abort the connection and discard any buffered messages.)
4 - Ping message (Sent by server)
5 - Pong message (required reply to ping message.)
6 - Text message
I've borrowed from the
draft-ietf-hybi-thewebsocketprotocol-03. The opcodes don't match at the moment. I thought of exposing the opcode via:
void sendMessage(byte opcode, String message)
void onMessage(byte opcode, String message)
instead of the current
void sendMessage(String message)
void onMessage(String message)
but that would require either allowing the client to send control frames, or throwing an exception if a non-data opcode is used.
An alternative would be to have:
sendTextMessage(String message)
sendJSOBNMessage(String json)
onTextMessage(String message)
onJSONMessage(String json)
I'm still on the fence about which way to go with it, so I kept it simple and restricted it to just text and leave the interpretation up to the client.