B4J Question Getting error on websocket.connect

tufanv

Expert
Licensed User
Longtime User
Hello,

I started getting an error after using the websocket for sometime without problem. The error happens on

ws.Connect("wss://websocket.xx.com/websocket");

before connecting I set these:
B4X:
    ws.Initialize("ws")
    Dim jo As JavaObject = ws
    jo = jo.GetField("wsc")
    jo = jo.RunMethod("getPolicy", Null)
    jo = jo.RunMethod("setMaxTextMessageSize", Array As Object (128000))

maybe messagesize is not enough ?

My dedicated server has plenty of ram cpu etc, it is not related to machine itself.


B4X:
main._vv4 (java line: 84)
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
    at java.base/java.lang.Thread.start0(Native Method)
    at java.base/java.lang.Thread.start(Thread.java:803)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper.Connect(WebSocketClientWrapper.java:63)
    at b4j.example.main._vv4(main.java:84)
    at b4j.example.main$ResumableSub_ws_closed.resume(main.java:672)
    at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1018)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153)
    at b4j.example.main._appstart(main.java:65)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.main(main.java:28)
 
Top