Android Question websocket error

nicolino33

Active Member
Licensed User
Longtime User
Hello all, I have one problem:

B4X:
Dim ws As WebSocket
ws.Initialize("ws")
Dim url As String = "wss://stream.binance.com:9443/ws/bnbusdt@miniTicker"
ws.Connect(url)

Error: java.lang.Exception: Sub ws_connected signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject b4a.example.b4xmainpage_subs_0._ws_connected(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception

Could you help me?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

nicolino33

Active Member
Licensed User
Longtime User
This is all I see in the error report, and the code that runs is just what I wrote earlier, where can I find the signature?


class anywheresoftware.b4a.pc.RemoteObject,
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
** Activity (main) Pause event (activity is not paused). **
** Activity (main) Resume **
Error occurred on line: 0 (Main)
java.lang.Exception: Sub ws_connected signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject b4a.example.b4xmainpage_subs_0._ws_connected(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception

class anywheresoftware.b4a.pc.RemoteObject,
 
Upvote 0

nicolino33

Active Member
Licensed User
Longtime User
B4X:
Sub ConnectToBinanceWebSocket()
    Public rp As RuntimePermissions
    rp.CheckAndRequest("INTERNET")
    
    Dim ws As WebSocket
    ws.Initialize("ws")
    Dim url As String = "wss://stream.binance.com:9443/ws/bnbusdt@miniTicker"
    ws.Connect(url)
End Sub
 
Upvote 0
Top