Advertisement

Getting SignalR trip time

Started by December 30, 2014 08:33 PM
0 comments, last by Angus Hollands 9 years, 10 months ago

I'm making a signalr game where the clients cast spells that take time. A progress bar is displayed on the client while the command is sent to the server via signalr. The server will start a timer, but I want the timer time to be the action time minus the trip time so when the timer is finished on the server and I send the result back to the client, it's timer will be finishing up.

I can't see how to find the trip time of the signalr call though. Does anyone know how to do this OR how I can get something like this?

I'm not sure why you need to determine the trip time. Essentially, the client should start a timer - fixed at a constant "good enough value" to cover the RTT + calculation time, and the server should attempt to return any results as fast as possible. The client will simply wait until the timer elapses, then poll a queue for the returned result, apply and discard it.

You don't need to have the result arrive "exactly" on time, unless there is some-how potential for cheating.

This topic is closed to new replies.

Advertisement