Skip to content

Commit 5174916

Browse files
committed
#461 Fixed issue that resulted in streams to not properly set the TwitterQuery timeout to Infinite
1 parent 6560718 commit 5174916

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Examplinvi/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Program
3535
{
3636
static void Main()
3737
{
38-
Auth.SetUserCredentials("54aUlLwbmRN7SX3wswMJmqpQG", "Fid46uknw6665bA4NxCiOHPoIUv6KMsaxhul7P4MwHMecIytYw", "1693649419-Ubxt4bKWWGQiRY9Ko4BcvX03EJUm2BPcRbW6pPM", "wLa7UFyp4FEDR2MHPtr6SEy4E3iCBqqlNAXuampl2SXZ7");
38+
Auth.SetUserCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
3939

4040
TweetinviEvents.QueryBeforeExecute += (sender, args) =>
4141
{

Tweetinvi.WebLogic/TwitterQuery.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ public TimeSpan Timeout
2828
get { return _timeout; }
2929
set
3030
{
31-
if (value.TotalMilliseconds <= 0)
31+
if ((int)value.TotalMilliseconds == 0) // Default
3232
{
3333
_timeout = TimeSpan.FromSeconds(10);
3434
return;
3535
}
3636

37+
if (value.TotalMilliseconds < 0) // Infinite
38+
{
39+
_timeout = TimeSpan.FromMilliseconds(System.Threading.Timeout.Infinite);
40+
return;
41+
}
42+
3743
_timeout = value;
3844
}
3945
}

0 commit comments

Comments
 (0)