Esempio n. 1
0
        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
            {
            }
        }
Esempio n. 2
0
 public void DelBot(ClientBot bot)
 {
     bots.Remove(bot);
 }