예제 #1
0
        public IObservable <byte[]> Receive()
        {
            lock (_gate)
                ++_count;

            return(_pipe.Receive());
        }
예제 #2
0
        public void Start()
        {
            while (!_token.IsCancellationRequested)
            {
                var c = (char)_streamReader.Read();
                _token.ThrowIfCancellationRequested();
                if (c == -1)
                {
                    Thread.Sleep(1);
                    continue;
                }

                if (_lastChar == '}' && c == '{')
                {
                    var s = _buffer.ToString();
                    _buffer.Clear();
                    var o = JsonConvert.DeserializeObject(s);
                    _pipe.Receive(o);
                }

                _lastChar = c;
                _buffer.Append(c);
            }
        }
 public IObservable <byte[]> Receive()
 {
     return(_pipe.Receive());
 }