jamiewest / signalr_core

ASP.NET Core SignalR Dart Client
https://pub.dev/packages/signalr_core
MIT License
90 stars 58 forks source link

Please make this change in your code #90

Open misici234 opened 2 years ago

misici234 commented 2 years ago

I tried to create a pull request but I was denied due to permission restrictions. It doesn't bother me as long as you make the following change in your code. It's in the file signalr_core/blob/main/lib/src/hub_connection.dart , line # 779 (the 2nd last in dynamic _processHandshakeResponse(dynamic data) ) _handshakeCompleter.complete(); Please surround this line with if condition and make it like this:

    if (!_handshakeCompleter.isCompleted) {
      _handshakeCompleter.complete();
    }

You have already done the same change in the method void _connectionClosed({Exception? exception}). The reason is that I had been getting occasional Exceptions from unprotected _handshakeCompleter.complete(); I made the change locally and tested it for a few weeks and never got this problem again. Please make this change and let us know when you will make new release! Thanks a lot.

mohamedsogoba commented 2 years ago

Hello broth ,you can signalR in background service in app is killed ?

misici234 commented 2 years ago

@mohamedsogoba I don't understand what you were talking about. I proposed a code change that has nothing to do with a background service.