SocketMeister 2.2.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package SocketMeister --version 2.2.4                
NuGet\Install-Package SocketMeister -Version 2.2.4                
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="SocketMeister" Version="2.2.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SocketMeister --version 2.2.4                
#r "nuget: SocketMeister, 2.2.4"                
#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.
// Install SocketMeister as a Cake Addin
#addin nuget:?package=SocketMeister&version=2.2.4

// Install SocketMeister as a Cake Tool
#tool nuget:?package=SocketMeister&version=2.2.4                

SocketMeister

Introduction

SocketMeister is an easy to use, high throughput, multithreaded, TCP Socket client and server for .NET. SocketMeister Client provides fault tolerance by automatically reconnecting in the event of connection failure and in environment where multiple servers are deployed (i.e. for redundancy and/or high workload), SocketMeister Client will automatically round-robin until a server is found. SocketMeister Server provides a simple framework whereby messages and requests (messages expecting a response) are presented in thread independent events. Your code site cleanly in the event handler, where it can read an array of parameters sent by the client and execute your business logic. In the case of a request, your code can provide a response, which is automatically returned to the client. SocketMeister supports binary arrays, strings and most simple data types. It you enable optional compression, data is seamlessly compressed and decompressed using a high throughput compression algorithm.

The Flavours of SocketMeister

SocketMeister Client works with most .NET framework versions, from .NET 3.5 and Silverlight 5 to .NET 5 and almost everything in-between. SocketMeister Server can be used with .NET 4.0 and above. There are 3 NuGet packages available:

The SocketMeister NuGet package contains the DLL for many versions of .NET except Silverlight 5. Frameworks include .NET 3.5, .NET 4.0, .NET 4.5, .NET 4.6, .NET 4.7.2, .NET Standard 2.0, .NET Core 3.1 and .NET 5. SocketMeister Server is not available in .NET 3.5.

The SocketMeister.Silverlight NuGet package contains the DLL for Silverlight 5 projects. SocketMeister server is not included as it wouldn't work in Silverlight.

The SocketMeister.Sources NuGet package contains the C# source files for SocketMeister, enabling you to embed SocketMeister in your own project EXE or DLL. This eliminates the need to ship the SocketMeister DLL with your product.

SocketServer Class.

Making a start with SocketServer requires only a few lines of code. The following will start the socket server on port 4505 and process messages and requests from clients.

using SocketMeister;
using System;

namespace MyApplication
{
	public class Server
	{
		//  Instatiate SocketServer on port 4505 with compression enabled
		private readonly SocketServer _socketServer = new SocketServer(4505, true);

		public Server()
		{
			//  Listen to MessageReceived and RequestReceived events
			_socketServer.MessageReceived += SocketServer_MessageReceived;
			_socketServer.RequestReceived += SocketServer_RequestReceived;

			//  Start the socket server
			_socketServer.Start();
		}

		private void SocketServer_RequestReceived(object sender, SocketServer.RequestReceivedEventArgs e)
		{
			//  Example request
			if (Convert.ToString(e.Parameters[0]) == "GetTimezoneDisplayName")
			{
				//  Response is a binary array
				e.Response = System.Text.Encoding.ASCII.GetBytes(TimeZoneInfo.Local.DisplayName); 
			}
		}

		private void SocketServer_MessageReceived(object sender, SocketServer.MessageReceivedEventArgs e)
		{
			//  Example message
			if (Convert.ToString(e.Parameters[0]) == "DoSomething")
			{
				//  Do something here
			}
		}
		
		public void Stop()
		{
			//  Stop the socket server before exiting the application
			_socketServer.Stop();
		}
	}
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 3.5

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net5.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SocketMeister:

Package Downloads
RemoteHub.Lirc

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.6 283 1/2/2024
4.0.5 144 12/31/2023
4.0.4 462 1/6/2022
4.0.3 275 12/26/2021
4.0.2 397 6/9/2021
4.0.1 400 3/26/2021
4.0.0 383 3/15/2021
3.0.0 419 3/11/2021
2.2.5 398 3/11/2021
2.2.4 396 3/8/2021
2.2.3 428 3/6/2021
2.2.2 346 3/1/2021
2.2.1 386 2/24/2021
2.2.0 352 2/23/2021
2.0.7 404 1/20/2021
2.0.6 349 1/15/2021
2.0.5 442 10/7/2020
2.0.4 511 10/1/2020
2.0.3 424 10/1/2020
2.0.2 423 10/1/2020
2.0.0 478 5/6/2020
1.0.3 625 4/4/2019
1.0.2 585 4/2/2019
1.0.1 578 4/1/2019
1.0.0 589 3/28/2019
0.1.0-beta 422 3/27/2019

Fixed bug where serializer caused warnings when SocketMeister.Source is incorporated into multiple projects or included in a DLL from another project. Serializer was public but should be internal. Could cause problems where multiple versions of SocketMeister are used in the same project.