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

Commented Issue: 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) =>
{
};
_sampleStream.TweetReceived += (sender, args) =>
{
if (args.Tweet.Text != null)
{
_tweetsCollection.Enqueue(args.Tweet);
}
};
_sampleStream.StartStream();
```
Comments: ** Comment from web user: mohibsheth **

No worries, take your time. I am using SetCredentials for the time being. Thanks for this library, its quite helpful.


Viewing all articles
Browse latest Browse all 4126

Trending Articles



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