Backendless Version (3.x / 5.x, Online / Managed / Pro )
Online - Trial
Client SDK (REST / Android / Objective-C / Swift / JS )
.Net 6.2.0
Application ID
4091BABD-BE94-1AF8-FF1C-E1CAB65DA400
Expected Behavior
I’m trying unsuccessfully to subscribe to real-time database changes (code and Github link below).
Actual Behavior
No connect or change listeners are ever called.
If I force a timeout by using a breakpoint, the DisconnectListener is fired twice with “ping timeout” and then “transport close” reasons. Occasionally I also see the ConnectErrorListener throw the message “The process cannot access the file ‘B:\Dev\TestRT\TestRT\bin\Debug\net7.0-windows\XunitTrace.txt’ because it is being used by another process.”
There is another issue which I mention in case it is related. None of the blocking calls ever return. For example, in the test application, I save an object to the database, it appears in the database but the application freezes and never recovers. I am wondering if the real time calls are doing the same preventing the listeners from firing.
Note
The documentation mentions that an additional dependency on Socket.io is required and says to read the Client-side Setup section for more information. This section has no information at all on Socket.io so I’m unsure if I’m missing a dependency or not. I would expect the SDK library to already have all all dependencies included.
Reproducible Test Case
Public Shared Sub Subscribe()
Log("Subscribing")
Dim eventHandler = Backendless.Data.Of("Test").RT
Backendless.RT.AddConnectListener(New RT.ConnectListener(Sub()
Log("Connected")
End Sub))
Backendless.RT.AddConnectErrorListener(New RT.ConnectErrorListener(Sub(a)
Log($"Connect Error :{a.Message}")
End Sub))
Backendless.RT.AddDisconnectListener(New RT.DisconnectListener(Sub(reason)
Log($"Disconnected - {reason}")
End Sub))
eventHandler.AddCreateListener(Sub(a)
Log($"Created: {a}")
End Sub)
eventHandler.AddUpdateListener(Sub(a)
Log($"Updated: {a}")
End Sub)
Log("Subscribed")
End Sub
Private Shared Sub Log(text As String)
Debug.WriteLine($"{Date.Now:F} {text}")
End Sub