Hsu.Formats.Replay 2026.7.13

dotnet add package Hsu.Formats.Replay --version 2026.7.13
                    
NuGet\Install-Package Hsu.Formats.Replay -Version 2026.7.13
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hsu.Formats.Replay" Version="2026.7.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hsu.Formats.Replay" Version="2026.7.13" />
                    
Directory.Packages.props
<PackageReference Include="Hsu.Formats.Replay" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Hsu.Formats.Replay --version 2026.7.13
                    
#r "nuget: Hsu.Formats.Replay, 2026.7.13"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Hsu.Formats.Replay@2026.7.13
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Hsu.Formats.Replay&version=2026.7.13
                    
Install as a Cake Addin
#tool nuget:?package=Hsu.Formats.Replay&version=2026.7.13
                    
Install as a Cake Tool

Hsu.Formats.Replay

Replay engine for the Hsu.Formats toolkit. It schedules recorded CAN trace logs (ASC, BLF, TRC, MDF, KME), mixed CAN + Ethernet trace logs (ASC, BLF), and pure Ethernet captures (PCAP, PCAPNG), then emits replay items over an Ethernet network transport (UDP in the current release).

This library does not capture or record — it replays recordings produced by the Hsu.Formats.Trace parsers.

Pipeline

file ─▶ streaming parser ─▶ ReplayPlanBuilder ─▶ ReplayPlan
                                                │
                ReplaySession (timing/speed/loop/pause/max-idle-gap)
                                                ▼
                           IReplayTransport / UdpReplayTransport / UdpDuplexTransport

Supported parser categories consumed by ReplayPlanBuilder:

  • IAsyncStreamingEventParser — mixed CAN + Ethernet trace logs
  • IAsyncStreamingTraceParser — frame-oriented CAN trace logs
  • IAsyncStreamingEthernetParser — Ethernet packet captures

Key Types

Type Role
ReplayPlanBuilder Parses a recording into time-ordered replay items
ReplayPlan / ReplayItem Immutable replay schedule and payload units
ReplaySession Time-accurate scheduler with Speed, Loop, Pause(), Resume(), and MaxIdleGap
IReplayTransport Output abstraction
UdpReplayTransport One-way UDP transport
UdpDuplexTransport UDP request/response transport for compare workflows
TcpReplayTransport One-way TCP transport
TcpDuplexTransport TCP request/response transport for compare workflows
IFrameEncapsulator<T> Payload mapping strategy (CanOverEthernetEncapsulator, EthernetOverUdpEncapsulator)
ReplayComparator Incremental expected-vs-live response matcher

Features

  • Replays CAN trace recordings and Ethernet captures over UDP transports
  • Preserves original inter-item timing with optional speed scaling
  • Optional looping playback
  • Pause/resume support without counting paused wall-clock time against playback timing
  • Optional MaxIdleGap compression for long silences in the source recording
  • Progress notifications after each item is sent
  • Duplex-response comparison support for replay/response workflows
  • Distinguishes CAN and Ethernet replay payloads on wire through a shared replay protocol prefix and typed payload kind
  • Supports both desktop UI and command-line execution paths on the desktop host

Quick Start

Replay an ASC trace

using Hsu.Formats.Asc;
using Hsu.Formats.Replay;

var parser = new AscParser();
var plan = await ReplayPlanBuilder.BuildAsync(
    parser,
    () => File.OpenRead("log.asc"));

using var transport = new UdpReplayTransport(new ReplayTarget("127.0.0.1", 5005));
using var session = new ReplaySession(plan, transport) { Speed = 1.0, Loop = false };

session.Progress += (_, e) => Console.WriteLine($"{e.SentCount}/{e.TotalCount}");
await session.RunAsync();

Replay an Ethernet capture

using Hsu.Formats.Pcapng;
using Hsu.Formats.Replay;

var parser = new PcapngParser();
var plan = await ReplayPlanBuilder.BuildAsync(
    parser,
    () => File.OpenRead("capture.pcapng"));

using var transport = new UdpReplayTransport(new ReplayTarget("239.1.2.3", 5005));
using var session = new ReplaySession(plan, transport)
{
    Speed = 1.0,
    Loop = false,
};

await session.RunAsync();

Replay from the CLI

ReplayTool cli --input capture.pcapng --host 127.0.0.1 --port 5005 --mode unicast
ReplayTool cli --input trace.asc --host 127.0.0.1 --port 5005 --compare --echo --builtin-responder

Timing Behavior

ReplaySession computes deterministic cumulative offsets from the source timestamps and uses one Stopwatch baseline for the active run.

Important behaviors:

  • Speed < 1.0 slows replay down
  • Speed > 1.0 speeds replay up
  • Pause() / Resume() stop and restart the timing clock
  • MaxIdleGap compresses long quiet periods without changing relative ordering
  • Loop = true restarts the plan after the last item

Comparison / Duplex Workflows

The replay subsystem also supports expected-vs-live response comparison.

Key pieces:

  • ReplayComparator
  • IResponseDecoder
  • IResponseCorrelator
  • CompareOptions
  • UdpDuplexTransport
  • TcpDuplexTransport

Typical workflow:

  1. build a replay plan from the recorded source
  2. capture expected response units from the recording
  3. replay over a duplex transport
  4. feed live responses into ReplayComparator
  5. build a ReplayComparisonReport

Encapsulation Model

Replay payload generation depends on the source event type:

  • CAN trace frames are encapsulated through CanOverEthernetEncapsulator
  • Ethernet capture packets are encapsulated through EthernetOverUdpEncapsulator
  • both payload families share the same replay protocol prefix and carry a typed message kind
  • CAN and Ethernet keep type-specific payload layouts while still belonging to one replay payload protocol family
  • mixed ASC/BLF event streams can produce both kinds of replay items in timestamp order

Documentation

  • Replay subsystem architecture and Ethernet capture design notes are documented in the project repository.
  • Standard format specifications, when present, are documented in the project repository.

Additional replay examples and validation scenarios are available in the project test suite.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.7.13 113 7/13/2026