Repository navigation
Quick Start
samgerene edited this page Oct 3, 2026
·
3 revisions
This guide walks you through setting up a minimal ArgusTransfer server with a route module and a client that sends requests to it.
- .NET 10.0 SDK or later
- Windows, Linux or macOS. Named pipes are a Windows IPC mechanism; on Linux and macOS, .NET maps them to Unix domain sockets. ArgusTransfer is tested on Windows and Linux; pipe ACLs (
PipeSecurity) apply to Windows only.
dotnet new console -n MyArgusService
cd MyArgusServiceAdd the ArgusTransfer package and the .NET generic host:
dotnet add package ArgusTransfer
dotnet add package Microsoft.Extensions.HostingCreate a module that registers a simple GET endpoint:
using System.Threading.Tasks;
using ArgusTransfer.Protocol;
using ArgusTransfer.Routing;
public class HelloModule : IArgusModule
{
public void AddRoutes(IArgusRouteBuilder app)
{
app.MapGet("/hello", context =>
{
context.Response = new ArgusResponse
{
StatusCode = ArgusStatusCode.Ok,
Body = "Hello from ArgusTransfer!"
};
return Task.CompletedTask;
});
}
}Set up the server and client in Program.cs:
using ArgusTransfer.Extensions;
using ArgusTransfer.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
services.AddArgusModules(); // Discovers HelloModule automatically
services.AddArgusPipeHost(o => o.PipeName = "demo"); // Listen on named pipe "demo"
services.AddArgusClient("demo"); // Register a client for the same pipe
services.AddHostedService<DemoClientService>(); // Run the client demo
})
.Build()
.Run();Create a background service that sends a request to the server:
using System;
using System.Threading;
using System.Threading.Tasks;
using ArgusTransfer.Client;
using Microsoft.Extensions.Hosting;
public class DemoClientService : BackgroundService
{
private readonly IArgusClient client;
private readonly IHostApplicationLifetime lifetime;
public DemoClientService(IArgusClient client, IHostApplicationLifetime lifetime)
{
this.client = client;
this.lifetime = lifetime;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await Task.Delay(1000, stoppingToken); // Wait for server to start
var response = await this.client.GetAsync("/hello", cancellationToken: stoppingToken);
Console.WriteLine($"Status: {(int)response.StatusCode} {response.StatusCode}");
Console.WriteLine($"Body: {response.Body}");
this.lifetime.StopApplication();
}
}dotnet runExpected output:
Status: 200 Ok
Body: Hello from ArgusTransfer!
- Architecture and Protocol -- understand the ARGUS/1.0 wire format
- Routing and Modules -- define CRUD endpoints with route templates and parameters
- Middleware -- add logging, authorization, and custom pipeline behavior
- Client Usage -- send requests with query parameters, streaming bodies, and timeouts
- Server Configuration -- configure concurrency limits, timeouts, and graceful shutdown
- Serialization -- add custom body serializers for JSON or other formats
- Dependency Injection -- understand the full DI integration
copyright @ Sam Gerené