SignalR hub Disconnects after 45minutes of connected to Server #59086
Labels
area-signalr
Includes: SignalR clients and servers
Author: Migration Bot 🤖
The issue was created by a issue mover bot. The author may not be the actual author.
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
This issue has been moved from a ticket on Developer Community.
I was trying to connect front end and back end to the server, it was connected but when the web app in idle for 45 minutes it gets disconnected, i want my web app to not get disconnect to the SignalR hub, I tried lots of code and read lots of documentation but i cant fix that issue
this was the code i used in my backend server
Starup.CS
services.AddSignalR(hubOptions =>
{
hubOptions.KeepAliveInterval = TimeSpan.FromSeconds(30);
});
app.MapHub<NotificationSignalrHub>(pattern: "/NotificationHub");
SignalRHub.CS
public async Task HandShakeToNotificationHub(UserConnection userConnection)
{
try
{
await Groups.AddToGroupAsync(Context.ConnectionId, GroupName);
}
public async Task SendMessage(string message)
{
try
{
var mar = getting the connection id from the Database;
if (mar is not null)
{
await Clients.Group(GroupName).SendAsync("ReceiveNotification", message);
}
}
catch (Exception ex)
{
throw;
}
}
please let me know what to do
Original Comments
Feedback Bot on 11/8/2024, 00:13 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: