users@tyrus.java.net

Re: maxMessageSize

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Sun, 14 Apr 2013 01:40:34 +0200

Yes, it is.

onClose with appropriate close code ( 1009) will be called on client
side, onError will be called on server endpoint only.

Pavel

On 4/14/13 1:18 AM, Arun Gupta wrote:
> For a WebSocket endpoint defined as:
>
> @OnMessage(maxMessageSize=6)
> public String echoText(String data) {
> return data;
> }
>
> If a message of size of 7 bytes is sent, then the following exception
> is thrown on the server-side:
>
> SEVERE: org.glassfish.tyrus.core.MessageTooBigException: Message too
> long; allowed message size is 6 bytes. (Current message length is 7
> bytes).
> at
> org.glassfish.tyrus.core.SessionImpl.checkMessageSize(SessionImpl.java:377)
> at
> org.glassfish.tyrus.core.SessionImpl.notifyMessageHandlers(SessionImpl.java:398)
> at
> org.glassfish.tyrus.core.EndpointWrapper.onMessage(EndpointWrapper.java:490)
> at
> org.glassfish.tyrus.server.TyrusEndpoint.onMessage(TyrusEndpoint.java:174)
>
> But onError is not invoked on the client-side.
>
> Is that the expected behavior ?
>
> Arun
>