Пример #1
0
        public string Read(Func <string, bool> condition)
        {
            string text = "";

            do
            {
                text += TelnetNegociator.Negociate(_stream);
            }while (condition(text));

            return(text);
        }
Пример #2
0
        public string Read(Func <string, bool> condition)
        {
            if (!_tcpClient.Connected)
            {
                throw new Exception("Not connected.");
            }
            if (!_tcpClient.GetStream().CanRead)
            {
                throw new Exception("Cant read Network Stream.");
            }
            while (_tcpClient.Available < 0)
            {
                Thread.Sleep(10);
            }

            string text = "";

            do
            {
                text += TelnetNegociator.Negociate(_tcpClient.GetStream());
            }while (condition(text));

            return(text);
        }