using System; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace SKMC.Api.Common.Tcp { /// /// TCP服务器接口 /// public interface ITcpServer { /// /// 设定服务参数 /// /// Host地址 /// Host端口 /// 是否长连接 void SetHost(string address, int port, bool keepAlived); /// /// 开启服务 (需要开新线程) /// /// 最大请求队列数 /// string输入输出工作 void Listen(int cacheSize, Func worker); /// /// 开启服务 (需要开新线程) /// /// 最大请求队列数 /// socket数据处理工作 void Listen(int cacheSize, Action worker); /// /// 关闭服务 /// void Close(); } }