public void Start() { sc = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint pnt = new IPEndPoint(IPAddress.Any, port); sc.Bind(pnt); sc.Listen(100); try { while (true) { Socket botSc = sc.Accept(); if (botSc.Connected) { ClientBot bot = new ClientBot(botSc, this); bots.Add(bot); Thread thread = new Thread(bot.Record); thread.Start(); } } } catch { } }
public void DelBot(ClientBot bot) { bots.Remove(bot); }