sefidgaran / signalr_client

A Flutter SignalR Client for ASP.NET Core
https://pub.dev/packages/signalr_netcore
MIT License
79 stars 112 forks source link

Server timeout elapsed #92

Closed diegorkalschne closed 2 months ago

diegorkalschne commented 3 months ago

Server timeout elapsed without receiving a message from the server.

Does anyone know what I could try to modify on the server to remove this error? Or to be able to test better?

Until recently, I was successfully using the package, in the same API. In debug mode, it works. But in release mode, it doesn't.

My code in client:

class SignalRService {
  SignalRService(this.serverUrl) {
    _hubConnection = HubConnectionBuilder()
        .withAutomaticReconnect()
        .withUrl(
          serverUrl,
          options: HttpConnectionOptions(
            requestTimeout: 60000,
          ),
        )
        .build();
  }

  late final String serverUrl;
  late final HubConnection _hubConnection;

  HubConnection get hubConnection => _hubConnection;

  Future<void> connect() async {
    await _hubConnection.start();
  }
}

In server:

public class MobileHub : Hub
{
//Methods
}

The hub is also registered in Startup.cs.

beebobox commented 2 months ago

@diegorkalschne : I am experiencing the same issue. Did you find a solution?

diegorkalschne commented 2 months ago

@beebobox On my Windows Server, the WebSocket protocol was not installed. After installing it, it started working again.

See: https://secure.jadeworld.com/developer-centre/JADE2018/OnlineDocumentation/content/resources/installconfig/ch3configuringjade/iisinstallforwebsocket.htm