Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Concurrency issues with the WebSocket client

As for messages occupying one frame...

There is nothing, absolutely nothing, in the javax.websocket (JSR-356) spec or the websocket protocol (RFC6455) spec that says 1 message is on 1 frame.
In fact, each of those specs specifically call out that a message can be part of [1..n] frames at the whims of the implementation and/or intermediates (like some websocket proxies)

Even the existence of various websocket extensions can fragment the message further into smaller and smaller frames.



--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Thu, Jul 2, 2015 at 8:38 AM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Your stacktrace says you are using streams.

  OnMessageTextStreamCallable(CallableMethod).call(Object, Object...) line: 70
  OnMessageTextStreamCallable.call(Object, Reader) line: 60
  JsrEvents<T,C>.callTextStream(RemoteEndpoint$Async, Object, Reader) line: 206
  JsrAnnotatedEventDriver$2.run() line: 340

That says your @OnMessage is either using streams directly, or via a Decoder.TextStream for that message type.


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Thu, Jul 2, 2015 at 8:27 AM, Jörg Henne <hennejg@xxxxxxxxx> wrote:
Joakim Erdfelt <joakim@...> writes:
> single-invocation-per-endpoint-instance contract WSC-5.1-2 does not apply to a
>  <at> OnMessage annotated method that works with Streams.
>
>
> The very nature of  <at> OnMessage with streams is that the first frame of
a message causes an invocation that is dispatched to a new thread, and all
subsequent frames for that message arrive via that dispatched thread (really
via the buffers that the thread has an is using)
>
> If another Message arrives, then that is also dispatched to a new thread, etc.

Thanks for your response. Unfortunately, I am not sure, that I can follow
you, in particular with respect to the streams you mention. I am using
atomic messages only. The messages are sent using sendObject(...) with a
suitable encoder configured and received through a corresponding decoder. It
is my understanding that each message should therefore occupy exactly one frame.
Should I switch to using a MessageHandler?

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top