ProCom 1.0.3

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

// Install ProCom as a Cake Tool
#tool nuget:?package=ProCom&version=1.0.3

Process Communicator

A small and easy to use component allowing the communication of data between various applications.

What you will find in this package

A simple and small component to

  • Create one or more listening servers with the communicator component.
  • Delete a listening server from your application.
  • Send raw data or object to a server.

How to install and use this framework

  • Install this package
  • Create a server in your application n°1:
   ICommunicator communicator = new Communicator();
   communicator.ReceivedMessage += OnReceivedMessage;
   communicator.CreateServer("Foo_Server");

   // or create default server. the server name is application name. 
   // Get the default server name in communicator.DefaultServerName.
   ICommunicator communicator = new Communicator(true);
   communicator.ReceivedMessage += OnReceivedMessage;

   // OnReceivedMessage is raised by all created servers.
   private static void OnReceivedMessage(object? sender, CommunicatorEventArgs e)
   {
       if (e.Message.TypeContent == typeof(SampleData))
       {
           Console.WriteLine("Receive object data.");
           SampleData data = e.Message.Get<SampleData>();
           Console.WriteLine($"ID               : {data.Id}");
           Console.WriteLine($"Name             : {data.Name}");
           Console.WriteLine($"Description      : {data.Description}");
           Console.WriteLine("----------------------------");
           Console.WriteLine(e.Message.Source);
           Console.WriteLine(e.Message.Content);
           Console.WriteLine(e.Message.SendedDts);
           Console.WriteLine(e.Message.ReceivedDts);
       }
       Console.WriteLine();
   }
  • Find a server directly in Communicator.
    ICommunicator communicator = new Communicator();
    communicator.CreateServer("App1");
    IServer server = communicator["App1"];  // --> returns the server component named 'App1'
  • Set one or more action method(s) based on template Action<Message> per individual Server.
    ICommunicator communicator = new Communicator();
    communicator.CreateServer("App1");
    communicator.CreateServer("App2");
    communicator["App1"].SetOperation((x) => { Console.WriteLine(x.Content); });
    communicator["App1"].SetOperation((x) => { Console.WriteLine("End of operations for APP1."); });
    communicator["App2"].SetOperation((x) => { Console.WriteLine("Hello World"); });
  • Send data to application n°2 or n°3 or ...
    internal class SampleData
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }

        public SampleData() { }
    }

    internal class Program
    {
        static void Main(string[] args)
        {
            ICommunicator communicator = new Communicator();

            SampleData data = new SampleData();
            data.Id = Guid.NewGuid();
            data.Name = "Foo";
            data.Description = "Bar";
            
            communicator.SendTo("Foo_Server", data);

            // for asynchronously:
            communicator.SendToAsync("Foo_Server", data);

            Console.ReadLine();
        }
    }
  • Send data to multiple application's.
    internal class SampleData
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }

        public SampleData() { }
    }

    internal class Program
    {
        static void Main(string[] args)
        {
            ICommunicator communicator = new Communicator();

            SampleData data = new SampleData();
            data.Id = Guid.NewGuid();
            data.Name = "Foo";
            data.Description = "Bar";
            
            string[] apps = { "Foo", "Bar", "FooBar" };

            communicator.SendTo(apps, data);

            // for asynchronously:
            communicator.SendToAsync(apps, data);

            Console.ReadLine();
        }
    }
  • List your servers created in the app.
    internal class Program
    {
        static void Main(string[] args)
        {
            ICommunicator communicator = new Communicator();
            string[] servers = communicator.Servers;

            Console.ReadLine();
        }
    }
  • Delete the server if necessary.
    internal class Program
    {
        static void Main(string[] args)
        {
            ICommunicator communicator = new Communicator();
            communicator.RemoveServer("Foo_Server");

            Console.ReadLine();
        }
    }
  • Or... use according to your ideas...
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net5.0-windows7.0 is compatible.  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.  net6.0-windows7.0 is compatible.  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. 
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.3 135 5/31/2023

none