preamble
A number of students have asked recently:NET network communication framework have any good recommendations?
Today DAYAO to share with you an open source based on the Apache License an integrated , feature-rich .NET (including C#,, F#) network communication framework : TouchSocket.
Featured Functions
One key to solve the TCP sticky packet problem, provide protocol templates, support the rapid realization of fixed packet header, fixed length, interval characters and other data message parsing.
function guide
functional module
A collection of communication models such as socket, TCP, UDP, SSL, namedPipe, HTTP, WebSocket, RPC, JsonRPC, WebAPI, XMLRPC, Modbus, and many more.
Support Framework
Console、WPF、Winform, Blazor Server, Xamarin, MAUI, Avalonia, Mono, Unity 3D (excluding WebGL), etc.
Supported environments
NET Framework 4.5 and above, .NET 6.0 and above, .NET Standard 2.0 and above.
Project Source Code
Simple Usage Example
TcpService
TcpService service = new TcpService();
= (client, e) => {return ; };// a client is connecting
= (client, e) => {return ; };//there is a client connection
= (client, e) => {return ; };// a client disconnects
= (client, e) =>
{
//Receiving information from the client
string mes = ();
($"Message has been received from {}: {mes}");;
return ;
};
(7789);//initialization
TcpClient
TcpClient tcpClient = new TcpClient();
= (client, e) => {return ; };//successfully connected to the server
= (client, e) => {return ; };// Disconnect from the server, not triggered when the connection is unsuccessful.
= (client, e) =>
{
//Receive information from the server
string mes = Encoding.(, 0, );
($"Received message: {mes}");;
return ;
};
("127.0.0.1:7789");
("RRQM");
Project source code address
More useful features and characteristics of the project welcome to the project open source address to view 👀, do not forget to give the project a Star support 💖.
- Open source address:/RRQM_Home/TouchSocket
- Online documentation:/docs/current/startguide
A selection of great projects and frameworks
This project has been included in the C#/.NET/.NET Core Excellent Projects and Frameworks Selection, focusing on the excellent projects and frameworks selection can let you keep abreast of the latest developments and best practices in the field of C#, .NET and .NET Core, and improve the efficiency and quality of development work. The pit has been dug, you are welcome to submit PR recommendations or self-recommendation (so that excellent projects and frameworks are not buried 🤞).
- GitHub open source address:/YSGStudyHards/DotNetGuide/blob/main/docs/DotNet/
- Gitee open source address:/ysgdaydayup/DotNetGuide/blob/main/docs/DotNet/