示例#1
0
        /// <summary>
        /// Gets the streams opened by the specified endpoint.
        /// </summary>
        /// <param name="end">The endpoint.</param>
        /// <returns></returns>
        public int GetOpenedStreamsBy(ConnectionEnd end)
        {
            if (end == ConnectionEnd.Client)
            {
                return(FlowControlledStreams.Count(element => element.Key % 2 != 0) +
                       NonFlowControlledStreams.Count(element => element.Key % 2 != 0));
            }

            return(FlowControlledStreams.Count(element => element.Key % 2 == 0) +
                   NonFlowControlledStreams.Count(element => element.Key % 2 == 0));
        }