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
<PackageReference Include="BIDTP.Dotnet.Core" Version="2.0.0" />
<PackageVersion Include="BIDTP.Dotnet.Core" Version="2.0.0" />
<PackageReference Include="BIDTP.Dotnet.Core" />
paket add BIDTP.Dotnet.Core --version 2.0.0
#r "nuget: BIDTP.Dotnet.Core, 2.0.0"
#:package BIDTP.Dotnet.Core@2.0.0
#addin nuget:?package=BIDTP.Dotnet.Core&version=2.0.0
#tool nuget:?package=BIDTP.Dotnet.Core&version=2.0.0
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.
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:
- Example.Client.Blazor - A Blazor client application based on the .NET Core
- Example.Client.Console - A console client application based on the .NET Core
- Example.Client.WPF - A WPF client application based on the .NET Core
- Example.Server.Console - A server console application based on the .NET Framework 4.8
- 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.
- Example.Server.Revit - A server application based on the .NET Framework 4.8 and Revit API
- Example.Schemas - Declaration of generic DTO schemas for client-server communication.
More examples in BIDTP.Dotnet.Tests.Integration
| Product | Versions 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. |
-
.NETFramework 4.8
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.