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

Created Unassigned: Exception in Sample Stream [2225]

$
0
0
I am trying to start a sample stream using the below code, but the stream shutdowns as soon as it starts. I created a handler for StreamStopped and got the following exception. Can you look at the code and tell me its something which I am missing or its a problem with the library?

```
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at AsyncExtensions.ReadLineAsync(TextReader source)
at Tweetinvi.Streams.Helpers.StreamResultGenerator.<StartStreamAsync>d__7.MoveNext()
```


```
TwitterCredentials.ApplicationCredentials = TwitterCredentials.CreateCredentials(ConfigurationManager.AppSettings["twitterAccessToken"], ConfigurationManager.AppSettings["twitterAccessTokenSecret"], ConfigurationManager.AppSettings["twitterConsumerKey"], ConfigurationManager.AppSettings["twitterConsumerSecret"]);

_sampleStream = Stream.CreateSampleStream();
_sampleStream.FilterTweetsToBeIn(Language.English);
_sampleStream.StreamStopped += (sender, args) =>
{
//Thread.Sleep(2000);
//_sampleStream.StartStream();
};
_sampleStream.TweetReceived += (sender, args) =>
{
if (args.Tweet.Text != null)
{
_tweetsCollection.Enqueue(args.Tweet);
}
};
_sampleStream.StartStream();
```

Viewing all articles
Browse latest Browse all 4126

Trending Articles



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