I used signalR on android with asp.net core 2.2. It's working well on iis express (Visual studio 2019) when I call the hub hubConnection.send("Send", message); on my android client. But when I deploy the asp.net core on iis 10 (windows server 2019), I have the following error message :
Cannot send data if the connection is not in the 'Connected'. and the connection state is DISCONNECTED.
My android client code :
HubConnection hubConnection = HubConnectionBuilder.create("server IP @").build();
try {
hubConnection.start();
//I added the following line to restart the hubConnection when disconnected for whatever reason but in vain ;-(
if (!hubConnection.getConnectionState().toString().trim().equals("CONNECTED"))
hubConnection.start();
hubConnection.send("Send", message);
} catch (Exception e) {
Log.e("Erreur hubconnection ", e.getMessage());
}
Android SignalR version 'com.microsoft.signalr:signalr:1.0.0'. Asp.net core (2.2) SignalR version : 1.1.0
Thanks