Websocket handler receive complete messages?

39 views
Skip to first unread message

Joan Pujol

unread,
Feb 24, 2016, 6:22:10 PM2/24/16
to vert.x
Hi,

When I use a ServerWebSocket handler(Handler<Buffer> handler) can I expect the handler to receive always completed messages?

If not, is there an easy way to manage complete messages?

Cheers,

Julien Viet

unread,
Feb 25, 2016, 1:59:05 AM2/25/16
to ve...@googlegroups.com
you need to use the frameHandler(Handler<WebSocketFrame>) and not the handler

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/8e2be72d-75e7-4eaa-8b9a-e40d85640b90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joan Pujol

unread,
Feb 25, 2016, 3:01:40 AM2/25/16
to vert.x
Thanks Julien,

Then I understand that I've to go with frames and if a message can have several frames I've to manage that manually, haven't it?

Cheers,

Julien Viet

unread,
Feb 25, 2016, 4:28:43 AM2/25/16
to ve...@googlegroups.com
yes.

the websocket can send complete message and fragment it into several frames (with writeBinaryMessage)

however it does not support frame gathering into a single message back, so you would need to do that based on the frame.


Reply all
Reply to author
Forward
0 new messages