EasyPipes 1.3.0
dotnet add package EasyPipes --version 1.3.0
NuGet\Install-Package EasyPipes -Version 1.3.0
<PackageReference Include="EasyPipes" Version="1.3.0" />
<PackageVersion Include="EasyPipes" Version="1.3.0" />
<PackageReference Include="EasyPipes" />
paket add EasyPipes --version 1.3.0
#r "nuget: EasyPipes, 1.3.0"
#:package EasyPipes@1.3.0
#addin nuget:?package=EasyPipes&version=1.3.0
#tool nuget:?package=EasyPipes&version=1.3.0
EasyPipes
Simple C# library for NamedPipe and TCP-based IPC
Written against .NET Standard 2.0, ought to be compatible with most modern .NET versions.
Usage
Server usage:
using EasyPipes;
// IService defines the IPC interface
public interface IService
{
int Sum(int one, int two);
}
// Calculator is the server class
class Calculator : IService
{
public int Sum(int one, int two)
{
return one + two;
}
}
// start up
Server server = new Server("pipename");
server.RegisterService<IService>(new Calculator());
server.Start();
// eventual shutdown
server.Stop();
Client usage:
using EasyPipes;
// IService defines the IPC interface
public interface IService
{
int Sum(int one, int two);
}
// setup client
Client client = new Client("pipename");
IService service = client.GetServiceProxy<IService>();
// execute remote operation
int result = service.Sum(6, 12); // = 18
Encrypted TCP:
using EasyPipes;
/// IService defines the IPC interface
public interface IService
{
bool Authenticate(string username, string password);
string GetSecretData();
}
// --------- SERVER --------------
class StatefulService : IService
{
private bool has_authenticated = false;
[EncryptIfTrue]
public bool Authenticate(string username, string password)
{
if(Authenticated(username, password))
{
this.has_authenticated = true;
return true;
} else {
return false;
}
}
public string GetSecretData()
{
if(has_authenticated)
return somesecretstuff;
else
throw new Exception("Not authenticated");
}
}
// start up
TcpServer server = new TcpServer(new IPEndPoint(address, port), new Encryptor(sharedkey));
server.RegisterStatefulService<IService>(typeof(StatefulService));
server.Start();
// eventual shutdown
server.Stop();
// --------- CLIENT -------------
// setup client
TcpClient client = new TcpClient(new IPEndPoint(address, port), new Encryptor(sharedkey));
IService service = client.GetServiceProxy<IService>();
// authenticate (transmitted in plaintext!)
if(service.Authenticate(username, password))
{
// transmit encrypted messages
string data = service.GetSecretData();
}
Remarks:
- By default there is a single instance of the server class used by all clients! Use the stateful service for service which require an instance per connection.
- It's primarily focussed on IPC on single-machine or swift LAN-connections, so it likely will not perform well with long-distance internet connections.
- Any and all arguments or return values are serialized using DataContractSerializer, so custom types that need to cross the connection should be designed accordingly.
- Provides optional AES256 encryption for TCP connections upon call to a labelled service method, for example after authentication
Licence
Mozilla Public Licence 2.0
In simple terms: You can use the library as-is for any of your own projects, but any changes to the library itself have to be available under the same terms.
| Product | Versions 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. |
-
.NETStandard 2.0
- Castle.Core (>= 4.3.1)
- System.Net.Primitives (>= 4.3.0)
- System.Net.Sockets (>= 4.3.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EasyPipes:
| Package | Downloads |
|---|---|
|
NextDesign.Interop
NextDesignのプロセス間通信のクライアントライブラリです |
|
|
LightningReview.Interop.Client
Lightning Reviewとプロセス間通信をするためののクライアントです。 |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on EasyPipes:
| Repository | Stars |
|---|---|
|
ConcreteMC/Alex
A Minecraft client written in C# aimed at compatibility with MC:Java & MC:Bedrock
|
Better ValueType support and custom NamedPipeServerStream construction