RabanSoft.ApplicationConnector 1.0.0

dotnet add package RabanSoft.ApplicationConnector --version 1.0.0
NuGet\Install-Package RabanSoft.ApplicationConnector -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="RabanSoft.ApplicationConnector" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RabanSoft.ApplicationConnector --version 1.0.0
#r "nuget: RabanSoft.ApplicationConnector, 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.
// Install RabanSoft.ApplicationConnector as a Cake Addin
#addin nuget:?package=RabanSoft.ApplicationConnector&version=1.0.0

// Install RabanSoft.ApplicationConnector as a Cake Tool
#tool nuget:?package=RabanSoft.ApplicationConnector&version=1.0.0

ApplicationConnector

This library was designed with the intention to provide a simple way to communicate between applications (Server<->Client).

For now, Pipeline and Sockets are supported as the underlying communication providers.

Console, Debug and Trace binders are already implemented and can be used to get the application output and broadcast it.

A use case for this library may be, for example, if you want to connect a Windows Service, on demand (while the service is running) to an external application, and process IO to\from the service. (you can use the provided DataTransforms to encrypt the IO data)

Another use case may be to live debug a Windows Service, when needed.

Server-Side (Send output and receive client commands)

using RabanSoft.ApplicationConnector.ConnectorHandlers;

..

var connectorServer = new PipelineConnectorServer(); // new SocketConnectorServer(customPort);
connectorServer.OnError += ..;
connectorServer.OnDataReceived += ..;
connectorServer.Start();

..

connectorServer.Send(..);

..

connectorServer.Stop();

Client-Side (Send commands and receive server output)

using RabanSoft.ApplicationConnector.ConnectorHandlers;

..

var connectorClient = new PipelineConnectorClient("serverProcessName"); // new SocketConnectorClient(customPort);
connectorClient.OnError += ..;
connectorClient.OnDataReceived += ..;
connectorClient.Start();

..

connectorClient.Send(..);

..

connectorClient.Stop();

Data Encryption

  • It is recommanded to use DataTransformers to encrypt the outgoing and incoming data so it will not be visible to MITM attacks, as well as to let only a verified consumer process to communicate with the producer process
using RabanSoft.ApplicationConnector.DataTransformers;

..

class CustomizedCryptoTransformer : TripleDESCryptoDataTransformer
{
  public override string SecretKey { get; set; } = "YourSecretPassword";
}

..

class CustomizedConnectorServer /** CustomizedConnectorClient */ : PipelineConnectorServer // PipelineConnectorClient/SocketConnectorServer/SocketConnectorClient
{
  public override IDataTransformer DataTransformer { get; set; } = new CustomizedCryptoTransformer();
}

var connectorServerBaseInstance = new CustomizedConnectorServer();

Console Output Binding (Producer process)

  • This binder gets Console.Write calls and broadcasts them using the connector server instance
using RabanSoft.ApplicationConnector.IOBinders;

..

ConsoleIOBinder.OnError += ..;
ConsoleIOBinder.Bind(connectorServerBaseInstance);

..

ConsoleIOBinder.UnBind();

Process Output Binding (Consumer process)

  • This binder only gets Debug.Write or Trace.Write output from the producer
  • The consumer actually attempts to attach a "debugger" to the producer process, which means the consumer process must have required previliges to attach to the other process, the two proccesses must be built in the same architecture (x86 or x64), and the producer process can be attached to only once.
  • <code>ProcessIOBinder.DetachAll()</code> must be called by the consumer process before it is terminated, otherwise the producer process will terminate together with the consumer.
using RabanSoft.ApplicationConnector.IOBinders;

..

ProcessIOBinder.OnData += ..;
ProcessIOBinder.OnError += ..;
ProcessIOBinder.Attach("DestinationProcessName");

..

ProcessIOBinder.DetachAll();
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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
1.0.0 477 12/25/2019