I am developing real-time client-server application using C# and SignalR. I need to send messages to client as fast as possible. My code on server:
for (int i = 0; i < totalRecords; i++)
{
hubContext.Clients.Client(clientList[c].Key).addMessage(
serverId, RecordsList[i].type + RecordsList[i].value);
Thread.Sleep(50);
}
If there is delay >=50 ms everything working perfect, but if there is no delay or delay is less then 50 ms some messages are missing.
I need to sent messages as fast as possible without delay.
I guess I need to check if message received and only after send another one.
How to do it in a right way?