Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: When starting user stream and network is unavailable, stream continuously raises Started and Stopped Events.

$
0
0
Hi,

Thanks this is way more clear, I think there is an example of such feature in Examplinvi but I will verify for UserStreams as they are behaving differently from all the other streams.
// Creating the stream and specifying the delegate
SimpleStream stream = new SimpleStream("https://stream.twitter.com/1.1/statuses/sample.json");

stream.StreamStopped += (sender, args) =>
{
    if (args.Value != null)
    {
        Console.WriteLine("An exception occured... Well just restart it!");
        Thread.Sleep(1000);
        stream.StartStream(token, x => ProcessTweet(x));
    }
};

// Starting the stream by specifying credentials thanks to the Token
stream.StartStream(token, x => ProcessTweet(x));
Also, if I solve this issue in Tweetinvi 0.9 would you be able to migrate or do you already have consequent quantity of code with 0.8.3?
Keep in touch.

Regards,
Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>