This project has moved and is read-only. For the latest updates, please go here.

Getting Threading.Timeout out of range using Streamming

Feb 1, 2011 at 3:09 PM


I'm trying to use Linq2Twitter to read streamming related to some keywores.

I follow the strictly the sample:

            if (auth != null && auth.IsAuthorized)
                ctx = new TwitterContext(auth);
                MessageBox.Show("Authorization Error");

            int count = 0;

            var streaming =
                (from strm in ctx.UserStream
                 where strm.Type == UserStreamType.Site &&
                       strm.Follow == "15411837,16761255" // these are relatively low-volume accounts,
                 // so you may want to add more to see results.
                 // i.e. add your account ID and tweet to see results.
                 select strm)
                .StreamingCallback(strm =>
                    Console.WriteLine(strm.Content + "\n");

                    if (count++ >= 10)

But ExecuteTwitterStream throws the following message:

ArgumentOutOfRangeException was unhandled
Timeout can be only be set to 'System.Threading.Timeout.Infinite' or a value > 0.
Parameter name: value

Another problem:  I'm trying to use strm.Track , but it forces me to use Follow.

Thanks for your help.



Feb 2, 2011 at 2:42 PM

Hi Marcos,

I'm a little busy right now, so it might take a while, but I'll take a look.


Feb 2, 2011 at 8:00 PM

Thanks, Joe,

Do your best, I'm really blocked.


Feb 2, 2011 at 11:38 PM

Hi Joe,

I found the problem, it's in lines 633/634 (and I guess 577/578) of TwitterExecute.  It overrides the standart timeout with 0.

I commented the lines and everything it's ok.


Feb 3, 2011 at 2:21 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 3, 2011 at 2:22 AM


Glad you got it; and thanks a lot for the fix. :)