/// <summary>
        /// TSD can customize the filter by themselves. 
        /// </summary>
        /// <param name = "filter">the filter callback to judge whether a received response is filtered or not. </param>
        /// <exception cref = "System.ArgumentNullException">the filter must not be null. </exception>
        /// <exception cref = "System.InvalidOperationException">The transport is null for not connected. </exception>
        public void CustomizeFilter(CustomizePacketFilterCallback filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            if (this.transport == null)
            {
                throw new InvalidOperationException("The transport is null for not connected."
                    + " Please invoke Connect(string server, string client) first.");
            }

            this.transport.PacketFilter.CustomizeFilterCallback = filter;
        }
        /// <summary>
        /// Clear all filters
        /// </summary>
        public void ClearFilters()
        {
            lock (this)
            {
                this.customizeFilterCallback = null;
                this.typeFilters.Clear();
            }

            //Logging.Logger.INFO(LogFilter.STACK, "Filters to be cleared.");
        }