public override void PacketReceived(ISessionFilterChain filterChain, IPacket packet) { if (packet == null || filterChain.Session != base._session) { base.PacketReceived(filterChain, packet); } else { lock (this) { if (_content == null) { _content = packet.Buffer; _endPoint = packet.EndPoint; } else { IBuffer content = packet.Buffer; if (_content.Remaining < content.Remaining) { IBuffer buffer = BufferFactory.GetBuffer( _content.Position + content.Remaining); buffer.Put(_content.Flip()); _content.Release(); _content = buffer; } _content.Put(content); _content.Flip(); } if (_content != null) { try { base.Recognize(_content, _endPoint); } finally { if (_content.HasRemaining) { _content.Compact(); } else { _content.Release(); _content = null; _endPoint = null; } } } } } }