B4J Question Websocket received data exceeds limit

tufanv

Expert
Licensed User
Longtime User
Hello,

The transmitted data from a websocket is exceeding the limits so i can't get the data: It gives this error:

B4X:
org.eclipse.jetty.websocket.api.MessageTooLargeException: Text message size [69727] exceeds maximum size [65536]

How can this be solved ? Thanks
 

OliverA

Expert
Licensed User
Longtime User
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Try:
B4X:
Dim ws As WebSocketClient
ws.Initialize("ws")
Dim jo As JavaObject = ws
jo = jo.GetField("wsc")
jo.RunMethod("setMaxTextMessageBufferSize", Array As Object (128000))
ws.Close
Sources used:
B4J_WebSocketClient GitHub repository (https://github.com/AnywhereSoftware...tware/b4j/objects/WebSocketClientWrapper.java)
Jetty documentation on WebSocketClient (https://www.eclipse.org/jetty/javad...e/jetty/websocket/client/WebSocketClient.html)
Thanks for the answer. This still gives the error:
org.eclipse.jetty.websocket.api.MessageTooLargeException: Text message size [70885] exceeds maximum size [65536]


I think what OliverA replied here is the b4j implementation because there is no options in b4j version. But Oliver's did not work for me.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0
Top