Example #1
0
            public void RemoveStream(MsQuicStream?stream)
            {
                bool releaseHandles;

                lock (this)
                {
                    StreamCount--;
                    Debug.Assert(StreamCount >= 0);
                    releaseHandles = _closing && StreamCount == 0;
                }

                if (releaseHandles)
                {
                    Handle?.Dispose();
                }
            }
Example #2
0
            public void RemoveStream(MsQuicStream?stream)
            {
                bool releaseHandles;

                lock (this)
                {
                    StreamCount--;
                    Debug.Assert(StreamCount >= 0);
                    releaseHandles = _closing && StreamCount == 0;
                }

                if (releaseHandles)
                {
                    if (NetEventSource.Log.IsEnabled())
                    {
                        NetEventSource.Info(this, $"{TraceId} releasing handle after last stream.");
                    }
                    Handle?.Dispose();
                }
            }