예제 #1
0
        public ClienteTCP(TcpClient cliente, string nombre)
        {
            this.TcpClient = cliente;
            Nombre         = nombre;
            Comprimir      = true;

            Instancias.Add(this);
            if (sub == null || sub.IsAlive == false)
            {
                sub      = new System.Threading.Thread(new System.Threading.ThreadStart(ComprobarDatosRecibidos));
                sub.Name = "ComprobarDatosTCP";
                sub.Start();
            }
        }
예제 #2
0
        public ClienteTCP(string host, int puerto, string nombre)
        {
            this.TcpClient = new TcpClient();
            this.TcpClient.Connect(host, puerto);
            Nombre    = nombre;
            Comprimir = true;

            Instancias.Add(this);
            if (sub == null || sub.IsAlive == false)
            {
                sub      = new System.Threading.Thread(new System.Threading.ThreadStart(ComprobarDatosRecibidos));
                sub.Name = "ComprobarDatosTCP";
                sub.Start();
            }
        }