Closed Mu2tini closed 2 years ago
Hi!
I'm trying to invoke sending a message to the server but get this: "Exception: Failed to invoke 'SendMessage' due to an error on the server."
Set up connection works but not sending messages. I'm running:
await _connection!.invoke('SendMessage', args: ['Bob', 'Says hi!']);
This is my hub on the backend:
public class ChatHub : Hub { public async Task SendMessage(List<dynamic> data) { await Clients.All.SendAsync("ReceiveMessage", data[1] as string); } }
Running this from a web client works but not from the signalr_core client. Do you know what might be wrong here? I'm using .Net Core 5.
Was using the arguments in Invoke as well as backend hub method in wrong way. So no issue on library. Check this guys PingPong game as a good reference for using it correctly. https://github.com/Ilushnik
Hi!
I'm trying to invoke sending a message to the server but get this: "Exception: Failed to invoke 'SendMessage' due to an error on the server."
Set up connection works but not sending messages. I'm running:
await _connection!.invoke('SendMessage', args: ['Bob', 'Says hi!']);
This is my hub on the backend:
public class ChatHub : Hub { public async Task SendMessage(List<dynamic> data) { await Clients.All.SendAsync("ReceiveMessage", data[1] as string); } }
Running this from a web client works but not from the signalr_core client. Do you know what might be wrong here? I'm using .Net Core 5.