protected void Start(Uri source_uri, ISourceStream source_stream) { WriteLock(() => { if (sourceStream != null) { sourceStream.Stopped -= SourceStream_Stopped; sourceStream.Stop(); } this.contentHeader = null; this.contents.Clear(); this.SourceUri = source_uri; sourceStream = source_stream; sourceStream.Stopped += SourceStream_Stopped; uptimeTimer.Reset(); uptimeTimer.Start(); sourceStream.Start(); }); OnContentChanged(); }
/// <summary> /// チャンネル接続を終了します。ソースストリームと接続している出力ストリームを全て閉じます /// </summary> public void Close() { if (!IsClosed) { if (sourceStream != null) { sourceStream.Stop(); } foreach (var outputStream in outputStreams) { outputStream.Stop(); } outputStreams = new OutputStreamCollection(); } }