using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperSocket.SocketBase.Command;
namespace SuperSocket.SocketBase.Protocol
{
///
/// Receive filter interface
///
/// The type of the request info.
public interface IReceiveFilter
where TRequestInfo : IRequestInfo
{
///
/// Filters received data of the specific session into request info.
///
/// The read buffer.
/// The offset of the current received data in this read buffer.
/// The length of the current received data.
/// if set to true [to be copied].
/// The rest, the length of the data which hasn't been parsed.
///
TRequestInfo Filter(byte[] readBuffer, int offset, int length, bool toBeCopied, out int rest);
///
/// Gets the size of the rest buffer.
///
///
/// The size of the rest buffer.
///
int LeftBufferSize { get; }
///
/// Gets the next Receive filter.
///
IReceiveFilter NextReceiveFilter { get; }
///
/// Resets this instance to initial state.
///
void Reset();
///
/// Gets the filter state.
///
///
/// The filter state.
///
FilterState State { get; }
}
}