Ipcez 0.1.0

dotnet add package Ipcez --version 0.1.0
                    
NuGet\Install-Package Ipcez -Version 0.1.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="Ipcez" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ipcez" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Ipcez" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ipcez --version 0.1.0
                    
#r "nuget: Ipcez, 0.1.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.
#:package Ipcez@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ipcez&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Ipcez&version=0.1.0
                    
Install as a Cake Tool

ipcez C# bindings

.NET 8 library that calls the ipcez C FFI via P/Invoke.

Recommendation: Use Ipcez.Connect(addr) for most cases: pass one endpoint string and set target / os in the environment for local, or use a ws:// / wss:// URL for remote. No need to pass target/os or pick address format yourself.

Requirements

  • .NET 8 SDK
  • Built ipcez_ffi native library (see below)

When a connection or I/O error occurs, the core library logs a message to stderr (e.g. ipcez: error: ...).

Build the native library

From the repository root:

cargo build -p ipcez-ffi --release

On Windows the library is target/release/ipcez_ffi.dll. The C# project has a post-build step that copies it from target\release (or target\debug when building in Debug) into the output directory, so building the C# project after building the Rust crate will place the DLL next to your assembly.

If the copy fails (e.g. path differs), set the output of ipcez-ffi to this repo’s target/release and ensure that directory is on the process path when running your app, or copy ipcez_ffi.dll manually into the application output directory.

Project layout

  • Ipcez/ — main project.
    • Native.cs — P/Invoke declarations.
    • Ipcez.cs — static API: Connect(addr).
    • IpcezSocket.cs — socket wrapper with Read, Write, Close, IDisposable.

How to use

  1. Local: Set env target=local and os=windows (or os=linux). Pass the endpoint: pipe name (e.g. "mypipe") on Windows, or socket path (e.g. "/tmp/ipcez.sock") on Linux. The library adds \\.\pipe\ on Windows if needed.
  2. Remote: Pass a WebSocket URL: "ws://host:port/path" or "wss://...". Env is ignored for URLs.

Use Ipcez.Connect(addr) for this behavior.

API

  • Ipcez.Connect(string addr) -> IpcezSocket — Connect with one endpoint string; uses env for local, or ws/wss URL for remote.
  • IpcezSocket.Read(byte[] buffer) -> int — Read into buffer; returns bytes read.
  • IpcezSocket.Write(byte[] buffer) -> int — Write; returns bytes written.
  • IpcezSocket.Close() — Close the socket. Implements IDisposable for using support.
using System.Text;
using Ipcez;

// Set env: target=local, os=windows (or linux). For remote, use a ws:// or wss:// URL.
using var socket = Ipcez.Connect("mypipe");  // or "ws://localhost:8080/" for remote
socket.Write(Encoding.UTF8.GetBytes("hello"));
var buf = new byte[256];
int n = socket.Read(buf);

The C# wrapper exposes only single-endpoint connect. For explicit target/os you would need the Rust API or an extended FFI.

Linux / macOS

The csproj copy step currently targets the Windows DLL. For Linux/macOS, build the FFI and copy libipcez_ffi.so or libipcez_ffi.dylib into the application output and ensure it is loadable (e.g. LD_LIBRARY_PATH or same directory as the app). P/Invoke in Native.cs may need a DllImport name per platform if the file names differ.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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
0.1.0 99 2/15/2026