Enabling Real-Time using .Net SDK (.Net Core 7)

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

Github Project

Hello, @Darren_Talbot.

The RT section in .NET is currently experiencing problems. There is a ticket BKNDLSS-30136. We’ll let you know in this thread when it’s fixed.

Additionally, error with blocking calls I cannot reproduce in your app with this simple code:

      Backendless.InitApp("4091BABD-BE94-1AF8-FF1C-E1CAB65DA400", "F54E5FC0-137E-45DE-AEA2-69804FD28294");

      var res = Backendless.Data.Of("Test").Save(new Dictionary<string, object> { { "foo", "gggg" } });
      Console.ReadLine();

Maybe you do not see the issue because your code is for a console application.

Mine is running in Winforms.

I converted your sample to VB instead of C# and ran it in the Winfoms context and the same issue was observed. The call from the function never returns and locks the application.

I have updated my sample application to demostrate.

1 Like

Thank you. I will look into it

Fixed in 6.7.0 version of .NET-SDK.