Activities of "mehmetceylan"

Hi liangshiwei ,

Thx for your support. Your first solution is enouh for me. I think domain project is not right place for signalr. I will move it to application. It seems solving the problem.

Sorry, ITransientDependency is added at our implementation. I forgot to write it when creating question. So, yes we can receive events.

Hi,

We are trying to set up SignalR for our project. When we trigger the message from the server side, client does not receive the first message but it receives the second. It does not receive the third, either. And it receives the fourth, it goes like this. Trigger is in the IDistributedEventHandler implemented class.

This is the server side:

class ReportEventHandler: IDistributedEventHandler<ReportEto>{
private readonly IHubContext<NotificationHub> _hubContext;

public ReportEventHandler(IHubContext<NotificationHub> hubContext)
{
    _hubContext = hubContext;
}
public async Task HandleEventAsync(ReportEto eventData)
{
    await _hubContext.Clients.All.SendAsync("MessageReceived","Message");       
}
}

This is the client side:

const connection = new signalR.HubConnectionBuilder() 
.withUrl(environment.apis.default.url + '/signalr-hubs/notification') 
.withAutomaticReconnect() .configureLogging(signalR.LogLevel.Information)
 .build(); 
connection.on('MessageReceived', () => { this.toastNotificationService.queueToastNotification('info', 'New Message!', 'message'); }); 
connection.start().catch(err => console.log(err));

Our Hub.

using Volo.Abp.AspNetCore.SignalR;

namespace PCDMS.SignalR
{
    public class NotificationHub : AbpHub
    {
    }
}

What could be the reason? Please help me understand and fix this. If we don't trigger signalr from event handler, it is working properly. If we add authorize keyword to hub, we can not receive any message.

  • ABP Framework version: v4.4.2
  • UI type: Angular
  • DB provider: EF Core
Showing 1 to 3 of 3 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11