Esempio n. 1
0
        public string RecvUntil(string stop)
        {
            string sb = "";

            while (true)
            {
                sb += Convert.ToChar(MainStream.ReadByte());
                if (sb.EndsWith(stop))
                {
                    break;
                }
            }

            return(sb);
        }
Esempio n. 2
0
        public string Recv(int length)
        {
            StringBuilder sb = new StringBuilder();
            int           i  = 0;

            while (true)
            {
                if (i == length)
                {
                    break;
                }
                sb.Append(Convert.ToChar(MainStream.ReadByte()));
                i++;
            }
            return(sb.ToString());
        }