Пример #1
0
        public override void Dispose()
        {
            if (this.pipeWriter != null)
            {
                this.pipeWriter.Stop();
                this.pipeWriter.Dispose();
                this.pipeWriter = null;
            }

            base.Dispose();
        }
Пример #2
0
        void IQueuedPipeStringWriterEventSink.OnStateChanged(
            QueuedPipeStringWriter writer,
            QueuedPipeStringWriterState state,
            Exception exception)
        {
            switch (state)
            {
            case QueuedPipeStringWriterState.Failing:
                this.RaiseListenerFailure(exception?.ToString());
                break;

            case QueuedPipeStringWriterState.Healthy:
                this.RaiseListenerRecovery();
                break;
            }
        }
Пример #3
0
        private TelemetryDaemonEventListener(
            string providerName,
            string enlistmentId,
            string pipeName,
            IEventListenerEventSink eventSink)
            : base(EventLevel.Verbose, Keywords.Telemetry, eventSink)
        {
            this.providerName = providerName;
            this.enlistmentId = enlistmentId;
            this.vfsVersion   = ProcessHelper.GetCurrentProcessVersion();

            this.pipeWriter = new QueuedPipeStringWriter(
                () => new NamedPipeClientStream(".", pipeName, PipeDirection.Out, PipeOptions.Asynchronous),
                this);
            this.pipeWriter.Start();
        }