OutWit.Communication.Client 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OutWit.Communication.Client --version 1.0.0
                    
NuGet\Install-Package OutWit.Communication.Client -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="OutWit.Communication.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OutWit.Communication.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OutWit.Communication.Client" />
                    
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 OutWit.Communication.Client --version 1.0.0
                    
#r "nuget: OutWit.Communication.Client, 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.
#addin nuget:?package=OutWit.Communication.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OutWit.Communication.Client&version=1.0.0
                    
Install as a Cake Tool

OutWit.Communication.Client

Overview

The OutWit.Communication.Client library provides a robust framework for client-side communication in the WitCom ecosystem. With features like encryption, token-based authorization, and flexible serialization, it enables secure and efficient communication with WitCom servers.

Features

1. Authorization

  • AccessTokenProviderPlain: No token, suitable for public or unauthenticated scenarios.
  • AccessTokenProviderStatic: Static token for secure, predefined access.
Example:
var client = WitComClientBuilder.Build(options =>
{
    options.WithAccessToken("your-access-token");
});

2. Encryption

  • EncryptorClientPlain: No encryption for lightweight communication.
  • EncryptorClientGeneral: RSA/AES encryption for secure data exchange.
Example:
var client = WitComClientBuilder.Build(options =>
{
    options.WithEncryption();
});

3. Serialization

  • JSON: Default format, ideal for debugging and compatibility.
  • MessagePack: High-performance, compact binary serialization.
Example:
var client = WitComClientBuilder.Build(options =>
{
    options.WithJson();
});

// Or for MessagePack:
var client = WitComClientBuilder.Build(options =>
{
    options.WithMessagePack();
});

4. Logging and Debugging

Integrate custom logging for debugging and monitoring:

var client = WitComClientBuilder.Build(options =>
{
    options.WithLogger(new ConsoleLogger());
});

5. Timeout Configuration

Set request and response timeouts for client operations:

var client = WitComClientBuilder.Build(options =>
{
    options.WithTimeout(TimeSpan.FromSeconds(30));
});

6. Proxy for Services

Automatically generates a proxy to interact with server-side services using interfaces:

var service = client.GetService<IMyService>();
service.SomeMethod();

Installation

Install the package via NuGet. Note: You also need to install the specific transport package you intend to use (e.g., OutWit.Communication.Client.Tcp, OutWit.Communication.Client.WebSocket, etc.):

Install-Package OutWit.Communication.Client

Getting Started

Basic Setup

var client = WitComClientBuilder.Build(options =>
{
    options.WithAccessToken("my-access-token");
    options.WithEncryption();
    options.WithJson();
    options.WithTimeout(TimeSpan.FromSeconds(10));
});

await client.ConnectAsync(TimeSpan.FromSeconds(5), CancellationToken.None);

Sending Requests

var request = new WitComRequest
{
    MethodName = "MyMethod",
    Parameters = new object[] { 1, "parameter" }
};

var response = await client.SendRequest(request);
Console.WriteLine(response.Status);

Handling Events

The client supports events for callbacks and disconnections:

client.CallbackReceived += request =>
{
    Console.WriteLine("Callback received!");
};

client.Disconnected += _ =>
{
    Console.WriteLine("Disconnected from server");
};

API Reference

WitComClient

The core class for client-side communication.

Key Methods:
  • ConnectAsync: Establishes a connection to the server.
  • SendRequest: Sends a request and receives a response.
  • GetService: Generates a client-side proxy for a server-side service.
Events:
  • CallbackReceived: Triggered when a server callback is received.
  • Disconnected: Triggered when the client disconnects from the server.

WitComClientBuilder

A fluent API for configuring and creating WitComClient instances.

Configuration Options:
  • .WithAccessToken: Sets the access token for authentication.
  • .WithEncryption: Enables encryption for secure communication.
  • .WithJson: Configures JSON serialization.
  • .WithMessagePack: Configures MessagePack serialization.
  • .WithTimeout: Sets the timeout duration.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on OutWit.Communication.Client:

Package Downloads
OutWit.Communication.Client.Tcp

TCP transport client for WitRPC, enabling network communication over TCP sockets (with optional TLS support) to connect to WitRPC servers.

OutWit.Communication.Client.WebSocket

WebSocket transport client for WitRPC, enabling real-time, full-duplex communication over WebSocket connections (great for internet or browser-based clients).

OutWit.Communication.Client.MMF

Memory-mapped file transport client for WitRPC, enabling high-speed inter-process communication via a shared memory region (for on-machine RPC calls).

OutWit.Communication.Client.Pipes

Named Pipes transport client for WitRPC, allowing efficient inter-process communication via named pipes on the local machine (with support for multiple clients).

OutWit.InterProcess.Host

Provides host-side functionality to launch external processes and connect to them via WitRPC, allowing your application to use out-of-process services as if they were local (handles process startup and client proxy generation).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 78 7/5/2025
2.0.0 119 6/6/2025
1.2.0 154 2/28/2025
1.1.1 160 2/1/2025
1.1.0 148 1/25/2025
1.0.2 170 1/11/2025
1.0.0 173 1/2/2025