4

I am using org.java_websocket.client.WebSocketClient to connect to a server from Android. Everything is working as expected, except when messages exceed a specific size. Does anyone know if you can increase the default maximum length?

WebSocketClient mWebsocketClient = new WebSocketClient(serverUri, new Draft_6455(), mHeaders, Constants.WEBSOCKET_CONFIG.CONNECTION_TIMEOUT) {
 @Override
 public void onOpen(ServerHandshake handshakeData) {
 Log.d(TAG, "Opened");
 mWebsocketClient.getConnection().
 }
 // Message does not come through if it exceeds a certain size
 @Override
 public void onMessage(String message) {
 Log.i(TAG, message);
 }
 @Override
 public void onClose(int code, String reason, boolean remote) {
 Log.i(TAG, String.format("Closed. Code: %s, Reason: %s, Remote: %s", code, reason, remote));
 }
 @Override
 public void onError(Exception ex) {
 Log.i(TAG, "Error " + ex.getMessage());
 }
}
asked May 11, 2018 at 16:03
3
  • 1
    I have the same problem. I believe the default max is 4kb. Commented May 11, 2018 at 19:59
  • 1
    This should have been fixed by github.com/TooTallNate/Java-WebSocket/pull/570, can you make sure you are using the latest version? Commented May 15, 2018 at 8:21
  • @TarunLalwani YES, it was indeed that! wow.. what a silly thing i did there, i was using an old version of the library. Thank you so much! Commented May 16, 2018 at 12:26

1 Answer 1

1
+50

This should have been fixed by below pull request

https://github.com/TooTallNate/Java-WebSocket/pull/570

Please make sure you are using the latest version

answered May 16, 2018 at 13:43
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.