CSharpRTMP.Core.Protocols.Cluster.BaseClusterProtocol.SignalInputData C# (CSharp) Method

SignalInputData() public method

public SignalInputData ( int recAmount ) : bool
recAmount int
return bool
        public override bool SignalInputData(int recAmount)
        {
            do
            {
                if (_waitlength == 0)
                {
                    _currentType = (ClusterMessageType) InputBuffer.ReadByte();
                    _waitlength = InputBuffer.Reader.ReadUInt16();
                }
                if (InputBuffer.AvaliableByteCounts >= _waitlength)
                {
                    var pos = InputBuffer.Position;
                    OnReceive(_currentType);
                    if (pos + _waitlength != InputBuffer.Position)
                        InputBuffer.Ignore((uint) (_waitlength + pos - InputBuffer.Position));
                    _waitlength = 0;
                }
            } while (_waitlength == 0 && InputBuffer.AvaliableByteCounts > 2);
            return true;
        }