aspnet / SignalR-samples

Samples for ASP.NET Core SignalR
753 stars 398 forks source link

When is it return type3 message. #126

Closed psh9508 closed 8 months ago

psh9508 commented 8 months ago

Hello, I am using ClientWebSocket in C# to connect to SignalR and test it.

When a certain button is pressed, I send a message to the client side "{\"arguments\":[\"" + txtBoxMessage.Text + "\"],\"invocationId\":\"0\",\"target\":\"Echo\",\"type\":1}\u001e";" Sending a message to the server, and on the server side, sending a message to the client: "await Clients.All.ReceiveMessageAsync(message);" message. On the client side, the message "ReceiveMessageAsync" with type1 as the target arrives normally.

However, as we continue to test, we sometimes receive messages of type3 instead of type1. Sometimes, messages with "ReceiveMessageAsync" as target do not arrive as expected by the client.

When I executed the code await Clients.All.ReceiveMessageAsync(message); on the server side Is there any way to know when a message of type3 is coming instead of a message of type1?

psh9508 commented 8 months ago

It was my own project problem.