jsr356-experts@websocket-spec.java.net

[jsr356-experts] Re: [jsr356-users] Re: RemoteEndpoint.sendObject()

From: Mark Thomas <mark_at_homeinbox.net>
Date: Fri, 08 Feb 2013 13:38:58 +0000

On 08/02/2013 01:37, Danny Coward wrote:
> Hi Mark,
>
> Thanks for bringing this up. I hadn't looked at this part of the API for
> a while and I think there are a few corrections to make.

No problem. I'm just working my through the API implementing it and
raising questions as I find them. I just wish I had more time to work on
this so I could raise the questions sooner.

> On 2/7/13 7:09 AM, Mark Thomas wrote:

>> 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?
> 0. If developer object, get the first Encoder in the list that will
> handle it.

OK. I might have a separate question around encoders/decoders but I'll
re-read the spec and Javadoc and start another thread if necessary.

>> 1. If primitive convert to Object.
>> 2. Object.toString()
> Yes. I *think* the Java class equivalents of primitives have a
> well-defined toString() ?

I believe they do.

>> What about arrays? toString() isn't going to work.
> Yes. Sorry. I think arrays and collections need to be removed. At one
> point we were looking for some equivalence with JAX-RS which does this
> (presumably they have their own collection encoding/decoding scheme),
> which is I think why it lingered there.

OK. Removing them clears that problem up.

>> 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.
> I think if we remove the arrays and collections it will be ?

Agreed.

Cheers,

Mark