jsr356-experts@websocket-spec.java.net

[jsr356-experts] RemoteEndpoint.sendObject()

From: Mark Thomas <mark_at_homeinbox.net>
Date: Thu, 07 Feb 2013 15:09:26 +0000

Just looking at implementing this and there very little information on
what is meant to happen.

Am I correct in assuming that the Object is meant to be converted to a
String and sent as a text message?

If yes, how is the conversion performed?
1. If primitive convert to Object.
2. Object.toString()

What about arrays? toString() isn't going to work.

How ever this conversion occurs, it needs to be consistent across
implementations and I can't find enough information in the specification
or Javadoc to determine what the behaviour should be.


A second question is how, if at all, does this relate to having
annotations like:

@WebSocketMessage
onMessage(long foo) {
    ...
}

The discussion on WEBSOCKET_SPEC-96 covers primitives and Object
equivalents but not arrays. It seems odd that this is not symmetrical
between send and receive.

Mark