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

New Post: Events stop firing

$
0
0
Hi,

You are not the first one reporting issues with the Stream. It looks like Twitter is having issues.
I will have to update the code to handle the disconnect. Here is a temporary fix for you.
var s = Stream.CreateSampleStream();
s.TweetReceived += (sender, args) => { Console.WriteLine(args.Tweet);}

// As per twitter documentation, the stream should be reseted after 30 seconds if nothing has been received by the WebRequestvar resetTimer = new System.Timers.Timer(30000);
resetTimer.Elapsed += (o, eventArgs) =>
{
    s.StopStream();
    s.StartStream();
};

s.JsonObjectReceived += (sender, args) =>
{
    resetTimer.Stop();
    resetTimer.Start();
};

s.StartStream();
This code is similar to what I will implement in coming versions.
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>