PeerCastStation.FLV.RTMP.RTMPSourceStream.OnConnectionStopped C# (CSharp) Method

OnConnectionStopped() protected method

protected OnConnectionStopped ( ISourceConnection connection, StopReason reason ) : void
connection ISourceConnection
reason StopReason
return void
    protected override void OnConnectionStopped(ISourceConnection connection, StopReason reason)
    {
      switch (reason) {
      case StopReason.UserReconnect:
        break;
      case StopReason.UserShutdown:
        Stop(reason);
        break;
      case StopReason.NoHost:
        Stop(reason);
        break;
      default:
        Task.Delay(3000).ContinueWith(prev => Reconnect());
        break;
      }
    }