Пример #1
0
        /// <summary>
        /// Free resources held by the sink.
        /// </summary>
        /// <param name="disposing">If true, called because the object is being disposed; if false,
        /// the object is being disposed from the finalizer.</param>
        protected override void Dispose(bool disposing)
        {
            // First flush the buffer
            base.Dispose(disposing);

            if (disposing)
            {
                _statsdUdp.Dispose();
            }
        }
Пример #2
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            Flush();

            if (!disposedValue)
            {
                if (disposing)
                {
                    statsdUDP?.Dispose();
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.

                // TODO: set large fields to null.
                statsdUDP = null;
                dog       = null;

                disposedValue = true;
            }
        }
Пример #3
0
 public void TearDownUdpListener()
 {
     udpListener.Dispose();
     udp.Dispose();
 }
 public void TearDownUdpListener()
 {
     _dogStatsdService.Dispose();
     _udpListener.Dispose();
     _udp.Dispose();
 }