Skip to content

Johno-ACSLive/ACS-Messaging

Repository files navigation

ACS Messaging

Build Status License

Build Status GitHub release (latest SemVer)

Build Status NuGet version (ACS.Messaging)

The Advanced Computing Services Messaging library allows Client/Server Communications. Each instance can either be a Server or a Client and supports TLS1.2 encryption.

History

In 2010 I found a library written by jmcilhinney who released a project here. It was a great library to learn async networking in VB.NET. My immediate need was binary data, not text.

Various updates were made, such as:

  • Support binary data for use in all kinds of applications.
  • Bump in .NET framework version meant I could switch from using callback methods to the async/await keywords.
  • Added support for encryption (TLS1.2 is forced if secure communications are enabled).
  • Migration from VB.NET to C# (to migrate to .NET Core / Standard, C# was needed as VB.NET consistently lagged behind in terms of feature support in new versions of .NET etc.).

Getting Started

TODO: Add documentation on library usage.

Basic sample code below as well as a sample server and client project to get you started. The library has intellisense support and should provide a lot of details but is very simple to use.

Server Init:

// Init MessageServer Object
MessageServer MS = new MessageServer(int Port, bool IsSecure, X509Certificate Certificate);

// Attach event handlers to functions
MS.ConnectionAccepted += MS_ConnectionAccepted;
MS.ConnectionClosed += MS_ConnectionClosed;
MS.MessageReceived += MS_MessageReceived;
MS.Log += MS_Log;

Client Init:

// Init MessageClient Object
MessageClient MC = new MessageClient(string Server, int Port, bool IsSecure);

//Attach event handlers to functions
MC.ConnectionAccepted += MC_ConnectionAccepted;
MC.ConnectionClosed += MC_ConnectionClosed;
MC.ConnectionFailed += MC_ConnectionFailed;
MC.MessageReceived += MC_MessageReceived;

// Connect to Remote Host (Server)
MC.Connect();

Contribute

If you're interested, check how to Contribute!

License

Licensed under Apache License, Version 2.0