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
hendrikdelarey
4624 silver badges12 bronze badges
-
1I have the same problem. I believe the default max is 4kb.Dave New– Dave New2018年05月11日 19:59:32 +00:00Commented May 11, 2018 at 19:59
-
1This should have been fixed by github.com/TooTallNate/Java-WebSocket/pull/570, can you make sure you are using the latest version?Tarun Lalwani– Tarun Lalwani2018年05月15日 08:21:58 +00:00Commented 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!hendrikdelarey– hendrikdelarey2018年05月16日 12:26:23 +00:00Commented May 16, 2018 at 12:26
1 Answer 1
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
Tarun Lalwani
147k11 gold badges217 silver badges278 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-java