/// <summary> /// 初始化 /// </summary> private void Init() { Pool = new SocketUserTokenPool(); _Listener = null; _Alive = false; _FirstStarted = true; _NormalClosed = false; }
/// <summary> /// Socket远程终结点数据发送 /// </summary> public void SendToRemoteEndPoint(SocketUserTokenPool pool, byte[] buffer) { Task.Factory.StartNew(() => { for (int i = 0; i < pool.Count(); i++) { try { pool[i].Socket.Send(buffer); } catch { Dispose((new List <dynamic>() { pool[i].Socket })); } } }); }