摘要:
异步模式,收到请求后马上返回namespace SocketTest{ public delegate byte[] IResponse(byte[] a,IPEndPoint b); public delegate void IErrorRedirect(string format,params object[] ea); public delegate void IInfoRedirect(string format, params object[] ea); public class SocketServer { #region Private... 阅读全文
摘要:
阻塞模式,每次需要连接时从池中取一个有效连接,有心跳机制(为了保持长连接)namespace Client{ internal class SocketClient { private Socket _socketClient; /// <summary> /// 锁标识(正在发送) /// </summary> private object Sending = new object(); /// <summary> /// 建立socket连接 /// </summar... 阅读全文