AK.F1.Timing.Utility.Server.Program.Playback C# (CSharp) Method

Playback() public method

Proxies a recorded live-timing message stream to connected clients.
/// Thrown when is . /// /// Thrown when is empty. /// /// Thrown when or is not positive. ///
public Playback ( string path, double speed = 1d, IPEndPoint endpoint = null, int connectionBacklog = 50 ) : void
path string The path of the recorded live-timing message stream.
speed double The playback speed.
endpoint System.Net.IPEndPoint The endpoint to bind to. The default is any on 4532.
connectionBacklog int The accept connection backlog.
return void
        public void Playback(string path, double speed = 1d, IPEndPoint endpoint = null, int connectionBacklog = 50)
        {
            Guard.NotNullOrEmpty(path, "path");
            Guard.InRange(speed > 0d, "speed");
            Guard.InRange(connectionBacklog > 0, "connectionBacklog");

            try
            {
                var reader = F1Timing.Playback.Read(path);
                reader.PlaybackSpeed = speed;
                RunCore(reader, endpoint, connectionBacklog);
            }
            catch(Exception exc)
            {
                Log.Fatal(exc);
            }
        }