A .NET library which can make your socket client development easier
C# Batchfile
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
Common support PreferDnsInAdvance Oct 12, 2017
Core fixed the building errors for .net projects Jan 9, 2018
Properties merged projects Nov 10, 2015
Protocol simplified the command abstraction Jun 2, 2016
Proxy allow TLS through an http proxy (#70) Sep 3, 2017
References/BouncyCastle changed to reference SuperSocket.ProtoBase by NuGet Nov 12, 2015
SuperSocket.ClientEngine.Core upgraded version to 0.10 Jan 31, 2018
SuperSocket.ClientEngine upgraded version to 0.10 Jan 31, 2018
Test upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
.gitattributes merged projects Nov 10, 2015
.gitignore added one more security option AllowCertificateChainErrors Nov 23, 2017
.travis.yml added travis build script Aug 7, 2016
Build.bat improved the build script Nov 14, 2015
EasyClient.cs format code Jan 27, 2018
EasyClientBase.Net20.cs format code Jan 27, 2018
EasyClientBase.cs format code Jan 27, 2018
Func.cs fixed some building issues Aug 24, 2016
GlobalAssemblyInfo.cs upgraded version to 0.10 Jan 31, 2018
LINQ.cs fixed some building issues Aug 24, 2016
MakeNugetPackage.bat upgraded to SuperSocket.ProtoBase.1.7.0.4 Nov 16, 2015
PackageEventArgs.cs improved the building process Nov 13, 2015
README.md updated readme Aug 7, 2016
SuperSocket.ClientEngine.Core.nuspec removed section about SL from nuget package Jan 31, 2018
SuperSocket.ClientEngine.MonoDroid.csproj upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
SuperSocket.ClientEngine.MonoTouch.csproj upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
SuperSocket.ClientEngine.Net.sln removed some useless files from the projects Apr 14, 2016
SuperSocket.ClientEngine.Net20.csproj fixed the building errors for .net projects Jan 9, 2018
SuperSocket.ClientEngine.Net35.csproj fixed the building errors for .net projects Jan 9, 2018
SuperSocket.ClientEngine.Net40.csproj fixed the building errors for .net projects Jan 9, 2018
SuperSocket.ClientEngine.Net45.csproj fixed the building errors for .net projects Jan 9, 2018
SuperSocket.ClientEngine.NetCore.sln added test project to the dotnet core solution Jan 9, 2018
SuperSocket.ClientEngine.SL40.csproj upgraded SuperSocket.ProtoBase to 1.7.0.14 and upgraded .net core lib… Mar 9, 2017
SuperSocket.ClientEngine.SL50.csproj upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
SuperSocket.ClientEngine.Silverlight.sln updated SuperSocket.ProtoBase to 1.7.0.7 Jun 28, 2016
SuperSocket.ClientEngine.UWP.csproj made UWP project pass build Aug 25, 2016
SuperSocket.ClientEngine.UWP.project.json upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
SuperSocket.ClientEngine.UWP.sln made UWP project pass build Aug 25, 2016
SuperSocket.ClientEngine.WP71.sln some missed changes Apr 11, 2012
SuperSocket.ClientEngine.WP80.csproj upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
SuperSocket.ClientEngine.WP80.sln updated to SuperSocket.ProtoBase 1.7.0.5 Apr 16, 2016
SuperSocket.ClientEngine.Xamarin.sln removed some useless files from the projects Apr 14, 2016
SuperSocket.ClientEngine.build end support for Silverlight Jan 9, 2018
SuperSocket.ClientEngine.iOS.csproj upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
SuperSocket.ClientEngine.nuspec removed section about SL from nuget package Jan 31, 2018
global.json upgraded to .net core 1.1 Mar 8, 2017
packages.SuperSocket.ClientEngine.MonoDroid.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.MonoTouch.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.Net20.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.Net35.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.Net40.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.Net45.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.SL50.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.WP80.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017
packages.SuperSocket.ClientEngine.iOS.config upgraded SuperSocket.ProtoBase 1.7.0.17 Jun 8, 2017

README.md

SuperSocket.ClientEngine Build Status NuGet Version

SuperSocket.ClientEngine is a .NET library for socket client rapid development. It provides easy to use and efficient APIs to simplify your socket development work about asynchronous connecting, data sending, data receiving, network protocol analysising and transfer layer encryption.

Build from Source Code

1. Download source code from Github or clone the repository;
2. Restore dependencies using NuGet; (Latest NuGet Visual Studio extension will restore dependencies before build automatically. You also can follow [This NuGet doc](https://docs.nuget.org/consume/package-restore#package-restore-approaches) to do it manually.)
3. Choose a correct solution file to build;

Install from NuGet

PM> Install-Package SuperSocket.ClientEngine

Usage

Create your ReceiveFilter Implementation according Your Network Protocol

SuperSocket.ClientEngine provides some powerfull basic ReceiveFilter classes (under the namespace "SuperSocket.ProtoBase") to help you simplify your protocol analysis:

TerminatorReceiveFilter
BeginEndMarkReceiveFilter
FixedHeaderReceiveFilter
FixedSizeReceiveFilter
CountSpliterReceiveFilter

You should design your own ReceiveFilter according yoru protocol details base on the basic ReceiveFilters provided by SuperSocket.ClientEngine:

class MyReceiveFilter : TerminatorReceiveFilter<StringPackageInfo>
{
	public MyReceiveFilter()
	: base(Encoding.ASCII.GetBytes("||")) // two vertical bars as package terminator
	{
	}
	
	// other code you need implement according yoru protocol details
}

Create an Instance of EasyClient and Initialize it with the ReceiveFilter which is created in the previous step

var client = new EasyClient();

// Initialize the client with the receive filter and request handler
client.Initialize(new MyReceiveFilter(), (request) => {
	// handle the received request
	Console.WriteLine(request.Key);
});

Make a Connection and then Start the Communication

// Connect to the server
var connected = await client.ConnectAsync(new IPEndPoint(IPAddress.Parse("192.168.10.11"), 25));

if (connected)
{
	// Send data to the server
	client.Send(Encoding.ASCII.GetBytes("LOGIN kerry"));
}