How to fix error Connection limit exceeded for User ?

Jun 2, 2014 at 10:40 AM
Edited Jun 2, 2014 at 10:41 AM
I am trying to create a new instance of filtered stream every time a new track is to be added to the stream.
// code that is called every time new track is added to DB and it initiate new filtered stream instance against 

static void InitStream()
{
    IFilteredStream filteredStream = Tweetinvi.Stream.CreateFilteredStream();

    TwitterCredentials.ExecuteOperationWithCredentials(
        TwitterCredentials.ApplicationCredentials, () =>
        {
            // _Twitters dictionary contains list of existing @mentions users as [twitter-screen-name, twitter-oauth-credentials]
            foreach (var t in _Twitters)
            {
                filteredStream.AddTrack("@" + t.Key);
            }

            filteredStream.MatchingTweetReceived += (sender, args) =>
            {
                Console.WriteeLine("@" + args.Tweet.Creator.ScreenName + ": " + args.Tweet.Text);

                if (ExceptionHandler.GetLastException() != null)
                     Console.WriteeLine("Error: " + ExceptionHandler.GetLastException().TwitterExceptionInfos.First().Message + Environment.NewLine);
            };
            filteredStream.StartStreamMatchingAnyCondition();
     });
}
Main() method calling InitStream() first time, it runs perfectly fine and stream starts listening to @mentions tracks successfully.
static void main (args[])
{
      TwitterCredentials.ApplicationCredentials = TwitterCredentials.CreateCredentials(
                Utils.AccessToken,
                Utils.AccessTokenSecret,
                Utils.ConsumerKey,
                Utils.ConsumerSecret);
      InitStream();
}
AddNewTrack() method calling InitStream() next time, when new @mention user is added to system. It just causes error in InitStream() as "Connection limit exceeded for User"
static void AddNewTrack ()
{
      InitStream();
}
  1. How can I make sure that there is no previous stream running before doing InitStream() ?
  2. Is there a way to KILL ALL existing streams ?
As a history:
_I actually intended to add tracks (@mentions) into a running filtered stream and used following code as suggested [ https://tweetinvi.codeplex.com/discussions/544053 ].
But unfortunately, after adding a new track, stream was always either shutdown with unknown error OR stopped listening to tweets at all.

So leaving that problem unsolved, I am tried the above mentioned way as alternate and still having issue in that._

Please help me to fix the issue of adding new tracks to a running steam, its badly needed .

Regards.