PeerCastStation.UI.HTTP.APIHost.APIContext.RestartChannelConnection C# (CSharp) Method

RestartChannelConnection() private method

private RestartChannelConnection ( string channelId, int connectionId ) : bool
channelId string
connectionId int
return bool
      private bool RestartChannelConnection(string channelId, int connectionId)
      {
        var channel = GetChannel(channelId);
        if (channel.SourceStream!=null && GetObjectId(channel.SourceStream)==connectionId) {
          channel.SourceStream.Reconnect();
          return true;
        }
        foreach (var yp in PeerCast.YellowPages) {
          var ac = yp.AnnouncingChannels
            .Where(s => GetObjectId(s)==connectionId)
            .Where(s => s.Channel.ChannelID==channel.ChannelID).FirstOrDefault();
          if (ac!=null) {
            yp.RestartAnnounce(ac);
            return true;
          }
        }
        return false;
      }