Aditya Pasumarthi
Aditya Pasumarthi

Reputation: 1289

Tyrus websocket client on native Android app closes abnormally on receiving more than 16KB binary messages from websocket server over WSS

I'm using Tyrus websocket client (version 1.12) in a native Android app (Java), to connect to a websokcet server over WSS. I'm able to send and receive binary messages. However when I try to receive a binary message from server that is greater than 16 KB in size, the Tyrus websocket client closes with "closed abnormally" reason.

The same server and same large messages work fine with HTML5/JavaScript websocket clients in chrome (Android) and safari (iOS).

I'm trying to debug the Tyrus websocket client source code, but its a long shot.

Just wondering if any one had any similar issue and can offer any clues.

Thanks & Regards, Aditya.

Upvotes: 3

Views: 443

Answers (2)

cstack
cstack

Reputation: 405

Sorry I don't know what the policy is for answering old questions, but it seems bad to leave them unanswered. I ran into a similar issue (but didn't see your question at the time). I set the max buffer size like this and it worked for me:

ClientManager client = ClientManager.createClient(c); 
client.getProperties().put("org.glassfish.tyrus.incomingBufferSize", 128000000); 
session = client.connectToServer(this, config, new URI("wss://" + SERVER + ":" + PORT + WEBSOCKETENDPOINT));

Here was my question: Spring Websocket Server Resets Connection When Sending Large Amounts of Data

Upvotes: 1

Takahiko Kawasaki
Takahiko Kawasaki

Reputation: 19011

I'm not sure but Session.setMaxBinaryMessageSize(int) may help you.

Upvotes: 0

Related Questions