Acl.CommStreamLog 4.1.0

dotnet add package Acl.CommStreamLog --version 4.1.0
                    
NuGet\Install-Package Acl.CommStreamLog -Version 4.1.0
                    
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="Acl.CommStreamLog" Version="4.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Acl.CommStreamLog" Version="4.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Acl.CommStreamLog" />
                    
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 Acl.CommStreamLog --version 4.1.0
                    
#r "nuget: Acl.CommStreamLog, 4.1.0"
                    
#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 Acl.CommStreamLog@4.1.0
                    
#: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=Acl.CommStreamLog&version=4.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Acl.CommStreamLog&version=4.1.0
                    
Install as a Cake Tool

Acl.CommStreamLog

A binary communication-stream log library. It persists the raw binary payloads exchanged between communicating peers into self-describing binary files, supporting per-hour / per-day / permanent storage, automatic rollover by size or record count, expiry cleanup, memory-mapped fast reading, and a pluggable parser framework.

Usage

using System;
using System.Threading;
using Acl.CommStreamLog;
using Acl.CommStreamLog.Data;
using Acl.CommStreamLog.IO;

// 1. Configure and create a writer (writers with the same LogKey are reused).
var settings = LogFileSettings.Create("ATS-ATP", @"D:\ATS\CommLog", 0x1001, 0x2001);
settings.StorageType = StorageType.Daily;   // SharpHourly / Daily / Permanent
settings.ExpiredDays = 7;
settings.MaxFileSize = 8 * 1024 * 1024;     // optional rollover threshold

var writer = CommStreamLogManager.CreateLogWriter(settings);

// 2. Write a record (payload <= 64 KB).
var record = CommStreamLogFile.NewRecord();
record.Content = payloadBytes;              // raw communication bytes
record.Header.Direction = StreamDirection.Input;
record.Header.TimeStamp = DateTime.Now;
writer.Write(record);

// 3. Dispose all writers before process exit.
CommStreamLogManager.Close();

Reading back:

using var reader = CommStreamLogManager.CreateFileStreamLogReader(@"D:\ATS\CommLog\... .commStreamLog");
var fileHeader = await reader.ReadFileHeaderAsync(CancellationToken.None);
await reader.ReadRecordHeadersAsync(CancellationToken.None);  // build the record index
var record = reader.GetRecord(0);                             // random access by index

A memory-mapped reader is available via CommStreamLogManager.CreateMemMappedLogReader(path).

Parser framework

Parsers are external assemblies that implement ICommLogRecordParser (or IPayloadLogRecordParser / IBytesParserSimilarityMatchable). They are auto-discovered by ParserManager.LoadParsers(paths) and can also be added globally through parsers\load.json next to the application:

{
  "extraPaths": [
    { "path": "D:\\Parsers", "includeSubDirectories": true },
    { "path": "D:\\ATS\\",   "includeSubDirectories": false }
  ]
}

License

MIT. See the repository root for the full license and the in-depth documentation.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
4.1.0 97 9/5/2026
4.0.0 97 9/3/2026
3.2.2 264 8/2/2024
3.2.1 244 7/4/2024
3.2.0 351 2/23/2024 3.2.0 is deprecated because it is no longer maintained.

移除 netframework4.8 与 net6.0的支持。