All Projects → UweKeim → Zetaipc

UweKeim / Zetaipc

Licence: apache-2.0
A tiny .NET library to do inter-process communication (IPC) between different processes on the same machine.

Projects that are alternatives of or similar to Zetaipc

Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (+18.92%)
Mutual labels:  json, ipc
Neutralinojs
Portable and lightweight cross-platform desktop application development framework
Stars: ✭ 4,731 (+4162.16%)
Mutual labels:  json, http-server
Autocser
AutoCSer is a high-performance RPC framework. AutoCSer 是一个以高效率为目标向导的整体开发框架。主要包括 TCP 接口服务框架、TCP 函数服务框架、远程表达式链组件、前后端一体 WEB 视图框架、ORM 内存索引缓存框架、日志流内存数据库缓存组件、消息队列组件、二进制 / JSON / XML 数据序列化 等一系列无缝集成的高性能组件。
Stars: ✭ 140 (+26.13%)
Mutual labels:  json, http-server
Httpbin
HTTP Request & Response Service, written in Python + Flask.
Stars: ✭ 10,423 (+9290.09%)
Mutual labels:  json, http-server
Cutelyst
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Stars: ✭ 671 (+504.5%)
Mutual labels:  json, http-server
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (+58.56%)
Mutual labels:  json, http-server
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+127.93%)
Mutual labels:  json, http-server
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (+213.51%)
Mutual labels:  json, http-server
Poco
The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
Stars: ✭ 5,762 (+5090.99%)
Mutual labels:  json, http-server
Lithium
Easy to use C++17 HTTP Server with no compromise on performances. https://matt-42.github.io/lithium
Stars: ✭ 523 (+371.17%)
Mutual labels:  json, http-server
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-55.86%)
Mutual labels:  json, http-server
Raftlib
The RaftLib C++ library, streaming/dataflow concurrency via C++ iostream-like operators
Stars: ✭ 717 (+545.95%)
Mutual labels:  machine, ipc
Zio Tls Http
100% non-blocking, Java NIO only( inspired by zio-nio) , JSON HTTP server based on Scala ZIO library. Everything including TLS encryption modeled as ZIO effects, convenient route DSL similar to https4s, up to 30K TPS local JSON transaction with 25 threads on 6 cores(i7) with ZIO fibers.
Stars: ✭ 71 (-36.04%)
Mutual labels:  json, http-server
Prettier
Prettier is an opinionated code formatter.
Stars: ✭ 41,411 (+37207.21%)
Mutual labels:  json
Webapiclient
An open source project based on the HttpClient. You only need to define the c# interface and modify the related features to invoke the client library of the remote http interface asynchronously.
Stars: ✭ 1,618 (+1357.66%)
Mutual labels:  json
React Jsonschema Form
A React component for building Web forms from JSON Schema.
Stars: ✭ 10,870 (+9692.79%)
Mutual labels:  json
Kripton
A Java/Kotlin library for Android platform, to manage bean's persistence in SQLite, SharedPreferences, JSON, XML, Properties, Yaml, CBOR.
Stars: ✭ 110 (-0.9%)
Mutual labels:  json
Json Git
A pure JS local Git to versionize any JSON
Stars: ✭ 109 (-1.8%)
Mutual labels:  json
Osiris
Free open-source game cheat for Counter-Strike: Global Offensive, written in modern C++. GUI powered by Dear ImGui.
Stars: ✭ 1,851 (+1567.57%)
Mutual labels:  json
Yq
Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
Stars: ✭ 1,688 (+1420.72%)
Mutual labels:  json

Zeta IPC

A tiny .NET library to do inter-process communication (IPC) between different processes on the same machine.

NuGet

Get the ZetaIpc NuGet package.

Background

First trying ZeroMQ to do some very small IPC between two WinForms processes on the same machine, I failed and didn't bother to dig deeper. Instead I used the phantastic C# WebServer project and quickly assembled some small wrapper.

I intentionally implemented only simple string send and receive methods, everything else is out of scope of the library. E.g. you could use Json.NET to transfer JSON within the strings between the client and the server.

Using the server

To use the server (i.e. the "thing" that listens for incoming request and answers them), do something like:

var s = new IpcServer();
s.Start(12345); // Passing no port selects a free port automatically.

Console.WriteLine("Started server on port {0}.", s.Port);

s.ReceivedRequest += (sender, args) =>
{
    args.Response = "I've got: " + args.Request;
    args.Handled = true;
};

This starts a new background thread and continues execution.

Later, simply call

s.Stop();

to stop the server again.

Using the client

To use the client (i.e. the "thing" that can send texts to the server), do something like:

var c = new IpcClient();
c.Initialize(12345);

Console.WriteLine("Started client.");

var rep = c.Send("Hello");
Console.WriteLine("Received: " + rep);

Bi-directional usage

If you want a bi-directional communication between the server and client that can be started by both the client and the server, simply use the above code of the server on the client and the code of the client on the server (use different ports, of course).

This gives you two applications, each of them being server and client at the same time.

How to tell the port from the client to the server?

I've developed the library to start an external application from my main application. My main application acts as the client and my external application as the server.

The whole process of starting and communicating with the external application roughly follows these steps:

  1. Main application is running.
  2. User clicks a menu item, which requires to launch the external application.
  3. By calling the FreePortHelper.GetFreePort() method on the main application, a free port number is being gathered.
  4. The main application calls the external application (through a relative file path) and passes the free port number as a command line parameter to the external application.
  5. The external application reads the so passed port number from the command line and starts an instance of IpcServer on this given port.
  6. The main application waits for a few seconds and then uses an instance of IpcClient to send messages to the external application and receives messages back. If you want to wait until the server has really started and is ready, you can use an event wait handle.

Notes

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].