コード例 #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 mountId,
            string pipeName,
            IEventListenerEventSink eventSink)
            : base(EventLevel.Verbose, Keywords.Telemetry, eventSink)
        {
            this.providerName = providerName;
            this.enlistmentId = enlistmentId;
            this.mountId      = mountId;
            this.vfsVersion   = ProcessHelper.GetCurrentProcessVersion();

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