LoguxNET.Client.Core 1.0.0

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

LoguxNET.Client.Core

Русская версия

Pure managed Logux Protocol v5 client library. Transport-agnostic, store-agnostic, works on any .NET runtime.

Target Framework

netstandard2.0 — compatible with .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5–10, Xamarin, MAUI, Blazor, Unity.

Structure

LoguxNET.Client.Core/
├── LoguxClient.cs           Protocol v5 client (connect, sync, subscribe, auto-reconnect)
├── LoguxClientOptions.cs    Client configuration (NodeId, Token, timeouts, reconnect)
├── LoguxClientState.cs      State enum: Disconnected → Connecting → Sending → Synchronized
├── LoguxAction.cs           Action: type + JSON payload
├── LoguxMeta.cs             Metadata: id, time, added, sync flag
├── LoguxProtocol.cs         Protocol message serialization / deserialization (internal)
├── ILoguxTransport.cs       Transport abstraction (WebSocket, TCP, mock, etc.)
├── ILoguxStore.cs           Persistence abstraction (action log + sync counters)
└── InMemoryStore.cs         Default in-memory store implementation

Quick Start

using LoguxNET.Client;

var client = new LoguxClient(
    new LoguxClientOptions
    {
        NodeId = "user1:abc:0",
        Token  = "secret-token",
    },
    transport);  // your ILoguxTransport implementation

client.ActionReceived += (action, meta) =>
    Console.WriteLine($"[{action.Type}] {action.Json}");

client.StateChanged += state =>
    Console.WriteLine($"State: {state}");

await client.StartAsync();

LoguxClient

Public API

Method Description
StartAsync() Load persisted state and connect to the server
SyncAsync(action, meta?) Add action to local log and send to server
SubscribeAsync(channel) Subscribe to a channel (auto-resubscribes on reconnect)
UnsubscribeAsync(channel) Unsubscribe from a channel
Destroy() / Dispose() Disconnect and release resources

Events

Event Signature Description
StateChanged Action<LoguxClientState> Connection/sync state changed
ActionReceived Action<LoguxAction, LoguxMeta> Action received from server
ErrorReceived Action<string, string?> Server sent an error message
Error Action<Exception> Transport or protocol error

Properties

Property Type Description
State LoguxClientState Current state
NodeId string Local node identifier
RemoteNodeId string? Server node ID (after handshake)
IsAuthenticated bool Handshake completed?

State Machine

Disconnected → Connecting → Sending → Synchronized
     ↑              │           │           │
     └──────────────┴───────────┴───────────┘
                 (on disconnect / error)

LoguxClientOptions

Property Type Default Description
NodeId string "" Client node ID ("userId:clientId:tabId")
Token string? null Authentication token
Subprotocol int 1 App subprotocol version
Protocol int 5 Logux protocol version
MinProtocol int 5 Minimum accepted protocol version
PingInterval TimeSpan 10 s Keepalive ping interval
Timeout TimeSpan 70 s Server response timeout
FixTime bool true Enable clock-drift correction
AutoReconnect bool true Auto-reconnect on disconnect
ReconnectBaseDelay TimeSpan 500 ms Initial reconnect delay
ReconnectMaxDelay TimeSpan 30 s Max reconnect delay (backoff cap)
MaxReconnectAttempts int int.MaxValue Max reconnect attempts

LoguxAction

// Create with type only
var action = LoguxAction.Create("counter/inc");

// Create with payload
var action = LoguxAction.Create("posts/add", new { id = "1", title = "Hello" });

// Parse from JSON
var action = LoguxAction.FromJson("{\"type\":\"counter/inc\",\"value\":1}");

// Deserialize
var payload = action.Deserialize<MyPayload>();

ILoguxTransport

public interface ILoguxTransport
{
    bool IsConnected { get; }
    Task ConnectAsync(CancellationToken ct = default);
    Task DisconnectAsync(CancellationToken ct = default);
    Task SendAsync(string message, CancellationToken ct = default);

    event Action Connected;
    event Action<string> MessageReceived;
    event Action<Exception?> Disconnected;
    event Action<Exception> ErrorOccurred;
}

Provide your own implementation for WebSocket, TCP, in-memory (for tests), or any other transport.

ILoguxStore

public interface ILoguxStore
{
    Task<SyncState> GetLastSyncedAsync();
    Task SetLastSentAsync(long sent);
    Task SetLastReceivedAsync(long received);
    Task<long> GetLastAddedAsync();
    Task<long> AddAsync(LoguxAction action, LoguxMeta meta);
    Task<IReadOnlyList<LogEntry>> GetSyncableEntriesAsync(long sinceAdded);
}

Default: InMemoryStore (data lost on process exit). Implement your own for SQLite, IndexedDB, etc.

Features

  • Auto-reconnect with exponential backoff
  • Auto-resubscribe to channels after reconnect
  • Resync unconfirmed actions after reconnect
  • Clock-drift correction (FixTime)
  • Keepalive ping/pong
  • Response timeout detection
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 was computed.  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
1.0.0 113 4/5/2026