Skip to content

tommasobertoni/Iris.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iris.NET

Iris.NET on SourceBrowser Iris.NET on NuGet

Iris.NET is a TCP-based, Pub/Sub C# library. It was developed to allow an easy-to-use, channel-separated communication on a LAN infrastructure.

The library provides a server and two client types: one for network communication and one for local communication.
The client types are also called nodes and they implement the IIrisNode interface, which defines the pub/sub methods (basically: Publish, Subscribe and Unsubscribe).

The IrisClientNode type is responsible for the network communication and talks to the IrisServer through a socket connection. It can be found in the Iris.NET.Client namespace.

The IrisLocalNode type, instead, is used to communicate locally (without sockets) with the same pub/sub infrastructure of the server.

The IrisServer type handles the connections coming from the client nodes. This and IrisLocalNode can be found in the Iris.NET.Server namespace.

How To

Create and start a server:

IrisServer server = new IrisServer();
server.Start(2200); // Start on port 2200

Create and connect a node over the network:

IrisClientConfig config = new IrisClientConfig() { Hostname = "127.0.0.1", Port = 2200 };
IrisClientNode node = new IrisClientNode();
node.Connect(config);

Subscribe to a channel

Task<IDisposableSubscription> asyncSubscriptionRequest = node.Subscribe("worldnews", MyContentHandler);
// The task is resolved when the subscription request is sent over the network stream
IDisposableSubscription subscription = await asyncSubscriptionRequest;

Publish a message

await node.Publish("worldnews", "something good happened");

A broader documentation is available in the How-To page in the wiki.

To see the new features that are being developed and the breaking changes head over to the Changelog in the wiki.
New features proposals and bug reports are displayed in the Issues section.


Technology info

This project was developed using Visual Studio 2015 and C# 6.

The library targets the .NET Framework 4.0.

License

Iris.NET is distributed under the MIT License.