OutWit.Communication.Server 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OutWit.Communication.Server --version 1.0.0
                    
NuGet\Install-Package OutWit.Communication.Server -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.Server" 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.Server" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OutWit.Communication.Server" />
                    
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.Server --version 1.0.0
                    
#r "nuget: OutWit.Communication.Server, 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 OutWit.Communication.Server@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=OutWit.Communication.Server&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OutWit.Communication.Server&version=1.0.0
                    
Install as a Cake Tool

OutWit.Communication.Server

Overview

The OutWit.Communication.Server library provides a powerful framework for creating servers in the WitCom ecosystem. It supports encryption, token-based authorization, and flexible serialization to ensure secure and efficient communication with clients.

Features

1. Authorization

  • AccessTokenValidatorPlain: No token validation for unauthenticated scenarios.
  • AccessTokenValidatorStatic: Static token validation for predefined secure access.
Example:
var server = WitComServerBuilder.Build(options =>
{
    options.WithAccessToken("your-access-token");
});

2. Encryption

  • EncryptorServerPlain: No encryption for lightweight communication.
  • EncryptorServerGeneral: AES encryption for secure data exchange.
Example:
var server = WitComServerBuilder.Build(options =>
{
    options.WithEncryption();
});

3. Serialization

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

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

4. Logging and Debugging

Integrate custom logging for debugging and monitoring:

var server = WitComServerBuilder.Build(options =>
{
    options.WithLogger(new ConsoleLogger());
});

5. Timeout Configuration

Set request and response timeouts for server operations:

var server = WitComServerBuilder.Build(options =>
{
    options.WithTimeout(TimeSpan.FromSeconds(30));
});

6. Service Support

Expose your services seamlessly using the WithService configuration.

Example:
var server = WitComServerBuilder.Build(options =>
{
    options.WithService(new MyService());
});

Installation

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

Install-Package OutWit.Communication.Server

Getting Started

Basic Setup

var server = WitComServerBuilder.Build(options =>
{
    options.WithAccessToken("my-access-token");
    options.WithEncryption();
    options.WithJson();
    options.WithTimeout(TimeSpan.FromSeconds(10));
    options.WithService(new MyService());
});

server.StartWaitingForConnection();

Stopping the Server

server.StopWaitingForConnection();

Handling Requests

Define your service to process client requests:

public class MyService
{
    public string Greet(string name)
    {
        return $"Hello, {name}!";
    }
}

Clients can invoke this service:

var request = new WitComRequest
{
    MethodName = "Greet",
    Parameters = new object[] { "John" }
};

API Reference

WitComServer

The core class for server-side communication.

Key Methods:
  • StartWaitingForConnection: Begins listening for client connections.
  • StopWaitingForConnection: Stops the server and releases resources.

WitComServerBuilder

A fluent API for configuring and creating WitComServer 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.
  • .WithService: Exposes a service for client requests.
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.Server:

Package Downloads
OutWit.Communication.Server.Pipes

Named Pipes transport server for WitRPC, enabling a server to handle client connections over named pipes (efficient local IPC with support for multiple clients).

OutWit.Communication.Server.WebSocket

WebSocket transport server for WitRPC, enabling a server to accept clients over WebSocket (great for real-time, browser-friendly communication).

OutWit.Communication.Server.MMF

Memory-mapped file transport server for WitRPC, allowing a server to listen for client connections via a shared memory segment (for high-performance on-machine communication).

OutWit.Communication.Server.Tcp

TCP transport server for WitRPC, enabling a server to host services over a TCP port (supports plaintext or TLS-secured connections).

OutWit.Communication.Server.Rest

REST transport server for WitRPC, exposing your services as HTTP REST endpoints to allow calls from web or external clients via standard HTTP.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 106 9/11/2025
2.0.1 133 7/5/2025
2.0.0 144 6/6/2025
1.2.0 181 2/28/2025
1.1.1 179 2/1/2025
1.1.0 166 1/25/2025
1.0.2 154 1/11/2025
1.0.0 185 1/2/2025