Found 42 packages
For replacing Kestrel by a simpler TCP server
Provides a high performance async tcp client and server implementation
A single-file event asynchronous(APM) tcp server and tcp client adapter for tcp debug assistant // A echo server TcpServer tcpServer = new TcpServer(IPAddress.Any, TcpServer.GetFreePort()); tcpServer.Start(_ => { _.OnAccept = client => { Console.WriteLine($"OnAccept: {client}"); }; _.OnReceive = (client, data) => { Console.WriteLine($"OnReceive: {client} {Encoding.UTF8.GetString(data)}"); client.Send(data, endPoint => Console.WriteLine($"Send: {endPoint} complated")); }; _.OnError = (client, ex) => { Console.WriteLine($"OnError: {client} {ex.Message}"); }; _.OnClose = (client, isCloseByClient) => { Console.WriteLine($"OnClose: {client} {(isCloseByClient ? "by client" : "by server")}"); }; }); Console.ReadKey(); tcpServer.Stop();
A simple tcp socket based server for Simple.Owin
A simple way to make a TCP server and contains methods relating to conversions
Simple framework for TCP clients and servers. Focused on performance and usability.
Net Standard 2.0 library for client-server data exchange based on tcp protocol.
Provides classes for fast and easy access to fast async tcp streaming, dns client, ssl client and server and ntp client and server implementations.
A scalable asynchronous Tcp Server for .NET
Description
Description
TCP server library. Ideally used with the corresponding TCP client library on the other end.
Nexus - ModbusTCPServer - Modbus TCP 서버 ---------------------------------------------- * 모드버스 TCP 서버 ---------------------------------------------- - 1.0.0 : 프로젝트 추가. - 1.0.1 : 의존성 패키지 업데이트. - 1.0.2 : 의존성 패키지 업데이트.
Package Description
Components offering implementations of core Internet Communication Protocols such as HTTP, FTP, SMTP, IMAP, LDAP, REST, SOAP, WebSockets, and DNS through simple, easy-to-use, and intuitive APIs.
Tcp Server
原生Socket实现用于TCP监听 TCPServer监听 UDP监听 HTTP 监听 1.2.0 增加Json/form-data数据直接转为实体对象给目标函数 路由标签使用方法时 方法所在类必须继承HttpRequest基类 1.2.5+ 增加对Task异步支持 更改 超过65535字节接收不了的问题 1.2.7 优化HTTP接收json时转换实体对象问题 1.2.8 解决formdata数据时解析字符串问题 1.2.10 优化异步数据接收 解决并发时数据接收不全的问题 1.2.11 增加无返回类型函数中通过this.Connection.send返回数据给客户端的功能 2.0.1 UDPServer中增加ClientSend方法 更改调用方式 2.0.2 允许使用 255.255.255.255 对某个端口进行广播 2.0.3 解决接收数据容易出现的已知问题 2.0.5 解决发送数据容易出现的已知问题 使用方式: ``` //TCP监听 var listener = TCPServer.Create(2020); listener.StartListen(s => { s.OnConnection = e => Console.WriteLine($@"OnConnection:{e.RemoteEndPoint}"); s.OnReceived = (e, data) => { Random random = new Random(); int randomNum = random.Next(0, 1000000); s.Send(Encoding.UTF8.GetBytes($@"ok>{s.RemoteEndPoint.ToString()}>>{randomNum}")); Console.WriteLine($@"OnData:{e.RemoteEndPoint},data:{Encoding.UTF8.GetString(data)}"); }; s.OnClosed = e => Console.WriteLine($@"OnClosed:{e.RemoteEndPoint}"); s.OnError = (conn, str, e) => Console.WriteLine($@"{conn.OnConnection} {str}:{e.Message}"); }); //UDP监听 var UDPlistener = UDPServer.Create(2020); UDPlistener.StartListen(s => { s.OnReceived = (e, data) => { Random random = new Random(); int randomNum = random.Next(0, 1000000); s.Send(s.RemoteEndPoint,Encoding.UTF8.GetBytes($@"ok>{s.RemoteEndPoint.ToString()}>>{randomNum}")); Console.WriteLine($@"UDP OnData:{e.RemoteEndPoint},data:{Encoding.UTF8.GetString(data)}"); }; s.OnError = (conn, str, e) => Console.WriteLine($@"{conn.RemoteEndPoint.ToString} {str}:{e.Message}"); }); //HTTP监听 var httplistener = HTTPServer.Create(2021); httplistener.SetPath(MethodEnum.GET, "/start"); httplistener.SetPath(MethodEnum.POST, "/start"); httplistener.StartListen(s => { //s.OnConnection = e => Console.WriteLine($@"OnConnection:{e.RemoteEndPoint}"); s.OnReceived = (e, Req) => { Random random = new Random(); int randomNum = random.Next(0, 1000000); s.Send($@"ok>{s.RemoteEndPoint.ToString()}>>{randomNum}"); Console.WriteLine($@"OnData:{e.RemoteEndPoint},data:{Req.Body}"); }; }); //HTTP监听路由写法: public class Workers : HTTPRequest { [Router("/start1", MethodEnum.GET)] public string Tests(string UserAccount, int Password) { Console.WriteLine("Body+>"+Content); return (new { code = 200, msg = "ok" }).ObjectToJson(); } [Router("/start1", MethodEnum.POST)] public object Tests2(string asd,List<int> aas) { foreach (var item in Headers) { Console.WriteLine(item.Key+":"+item.Value); } return new { code = 200, msg = "ok" }; } [Router("/start2", MethodEnum.POST)] public object Tests3(Testss testss) { foreach (var item in Headers) { Console.WriteLine(item.Key + ":" + item.Value); } return new { code = 200, msg = "ok" }; } } public class Testss { public string? UserAccount { get; set; } public string? Password { get; set; } } ```
Easy-TCP-Server is an easy-to-implement TCP server which handles incoming TCP data from multiple clients via 'channels' of connections between the clients and the server.
现代化TCP服务器通信库,支持多客户端连接管理、异步数据传输、SSL/TLS安全通信、心跳检测、连接池管理等功能,基于.NET 8.0构建
TCP Library for Server