Hey Kim Hwa Khoo (DHL IT Services),
I see you're facing connection issues with your Azure SignalR service, specifically "connection refused" and "connection timeout" errors to the specified endpoint. That sounds frustrating! Here are a few steps and suggestions you can try to troubleshoot the problem:
- Check for Multiple Device Clients: Make sure that each device has its own identity. If multiple devices are sharing connection strings, they can compete for connections, which might lead to timeouts or dropped connections.
- Validate Network Connectivity: Ensure there are no network connectivity issues between your application server and the Azure SignalR service. You might want to check for firewalls or security groups that could be blocking incoming/outgoing connections.
- Look at Server Logs: Check your app server logs for any abnormal events or errors that could indicate why the connections are being refused or timing out. Event logs can reveal if there were any recent restarts or failures.
- Connection Restart Logic: Implement a reconnect strategy on the client-side. Azure SignalR has a built-in "Always Reconnect" strategy, and you can also add custom reconnection logic to handle dropped connections effectively.
- Transport Protocols: SignalR uses various transport protocols (like WebSockets, Server-Sent Events, etc.). Ensure that your server supports WebSocket, and that it is enabled in IIS if you’re using it.
- SDK Version: Make sure you are using the latest version of the Azure SignalR SDK. Some issues can be fixed in newer releases.
- Diagnostics Tools: Use tools like Fiddler or the browser's developer console to inspect outgoing requests and see if the client is communicating correctly with the service.
- SkipNegotiation Flag: If you are using
SkipNegotiation, ensure it's set correctly as skipping negotiation might prevent the connection from being established properly.
Here are some relevant documentation links that can help you further:
- How to troubleshoot connectivity issues
- Troubleshoot server connection drops
- Troubleshoot client connection drops
- Detect and troubleshoot disconnects
Hope this helps! If the problem persists, feel free to share more details, and we can dig deeper into the issue!