BIDTP.Dotnet.Core 2.0.0

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

Preface

BIDTP-dotnet - this is library for implementing client-server architecture for inter-process communication based on BIDTP protocol for dotnet.

Bidirectional Interprocess Data Transfer Protocol (BIDTP) - a simple-to-use data exchange protocol between two processes.

References diagram

Questions and answers

Ask:

  • Why should I split my application into client and server?

Answer:

  • Separate testing and debugging of applications. It's easier to abstract yourself
  • Independence from stack and technologies
  • Separate process, domain for each application. If your application works as a plugin, then this solves the problem of dependency conflicts (Addin Autodesk Revit)
  • Separation of areas of responsibility for application development - if it is developed in a team

Ask:

  • Why should I use this protocol if I can use web protocols?

Answer:

  • This protocol is intended for local tasks of interaction between two processes. If you use web protocols for such tasks, you may encounter unexpected problems on the client side. For example - the client’s port is closed or there is a problem with the network

Ask:

  • It's too complicated, I'll have to write a lot of code to interact with the business logic. It's easier to call a service or method directly within one process

Answer:

  • The protocol is provided with the entire infrastructure with features that allow not only to minimize the cost of writing code for interaction, but also provide general functionality - necessary for creating modern applications - on the client and server sides

Philosophy and goals

The main issues addressed by this protocol include facilitating simple interaction between two processes. This enables independent and implicit communication between applications, regardless of the technologies used in their development.

The same effect can be achieved by using web protocols such as WebSocket, TCP, UDP, HTTP, and others. However, their obvious downside is that for their correct operation, it is necessary to ensure that the required ports are open on the local machine of the client or server and there are no issues with the network infrastructure.

In the current approach, data exchange between processes occurs at a lower level (byte-to-byte).

Acknowledgements

I express my deep gratitude to Nice3point (Roman Karpovich), particularly for his article on process communication: https://github.com/atomatiq/InterprocessCommunication

Structure of BIDTP protocol

Below are listed the main components along with their general descriptions.

Interaction scheme

The BIDTP protocol is based on client-server interaction. Communication between the components occurs using messages in a byte stream (pipe stream). The messages consist of Request\Response objects.

Requirements to request

The request object has the following structure:

Field name Type Size (bytes)
MessageLength int 4
HeadersLength int 4
HeadersContent string var
BodyLength int 4
BodyContent string var

Requirements to response

The response object has the following structure:

Field name Type Size (bytes)
MessageLength int 4
StatusCode enum (int ) 4
HeadersLength int 4
HeadersContent string var
BodyLength int 4
BodyContent string var

Status code

The status code is a specific code (classification) of responses from the server according to this protocol. The main status codes and their descriptions are provided below:

Code Description
Success 100 - Successful response from the server
ClientError 200 - Not successful Server response - error on client side
Unauthorized 201 - Not successful Server response - client is not unauthorized
NotFound 202 - Not successful Server response - route not found
ServerError 300 - Not successful Server response - error on server side

Examples

In the repository, there are examples of .NET applications:

  1. Example.Client.Blazor - A Blazor client application based on the .NET Core
  2. Example.Client.Console - A console client application based on the .NET Core
  3. Example.Client.WPF - A WPF client application based on the .NET Core
  4. Example.Server.Console - A server console application based on the .NET Framework 4.8
  5. Example.Server.Console.OwnerProcess - A server console application based on the .NET Framework 4.8, which runs another client-child process. U can build and run Example.Client.WPF.
  6. Example.Server.Revit - A server application based on the .NET Framework 4.8 and Revit API
  7. Example.Schemas - Declaration of generic DTO schemas for client-server communication.

More examples in BIDTP.Dotnet.Tests.Integration

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 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 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  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
2.0.0 182 6/12/2024
1.3.2 189 3/31/2024
1.3.1 162 3/31/2024
1.2.1 184 3/24/2024
1.2.0 175 3/22/2024
1.0.0 190 3/22/2024