mandrewcito / signalrcore

SignalR Core python client
https://mandrewcito.github.io/signalrcore/
MIT License
119 stars 57 forks source link

Problems on "hub_connection.send()" call directly after starting the connection #108

Closed 7Sebastian94 closed 10 months ago

7Sebastian94 commented 10 months ago

Describe the bug I faced an issue with calling HubConnectionBuilder.send() immediately after calling HubConnectionBuilder.start()

To Reproduce https://stackoverflow.com/questions/77680831/signalr-communication-between-python-and-aspnet

Expected behavior C# application to enter function SendGemstoneDetailMessage

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context The fix was about adding time.sleep(3) in between start and send method. Looking at the log tells me "SignalRCoreClient - WARNING - Connection closed socket is already closed."

However, the package should ensure that the function works properly, not the user. (Or at least an exception should be thrown, that sending is not possible at the moment)

7Sebastian94 commented 10 months ago

I am very sorry that I reported a problem, because it was an integration error.

Solution: You need to execute the sending whenever event "on_open" will be thrown.