Пример #1
0
 /// <summary>
 /// Closes stream, unsubscribes provides, sends stoppage notifications and broadcast close notification.
 /// </summary>
 public override void Close()
 {
     lock (this.SyncRoot)
     {
         if (_closed)
         {
             return;// Already closed
         }
         _closed = true;
         if (_livePipe != null)
         {
             _livePipe.Unsubscribe(this as IProvider);
         }
         if (_recordPipe != null)
         {
             _recordPipe.Unsubscribe(this as IProvider);
         }
         if (_recording)
         {
             SendRecordStopNotify();
         }
         SendPublishStopNotify();
         // TODO: can we send the client something to make sure he stops sending data?
         _connMsgOut.Unsubscribe(this);
         NotifyBroadcastClose();
     }
 }
Пример #2
0
 /// <summary>
 /// Closes the server-side stream.
 /// </summary>
 public override void Close()
 {
     lock (this.SyncRoot)
     {
         if (_state == State.PLAYING || _state == State.PAUSED)
         {
             Stop();
         }
         if (_msgOut != null)
         {
             _msgOut.Unsubscribe(this);
         }
         _recordPipe.Unsubscribe((IProvider)this);
         NotifyBroadcastClose();
         _state = State.CLOSED;
     }
 }