{"action":"created","issue":{"url":"https://api.github.com/repos/linvi/tweetinvi/issues/149","repository_url":"https://api.github.com/repos/linvi/tweetinvi","labels_url":"https://api.github.com/repos/linvi/tweetinvi/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/linvi/tweetinvi/issues/149/comments","events_url":"https://api.github.com/repos/linvi/tweetinvi/issues/149/events","html_url":"https://github.com/linvi/tweetinvi/issues/149","id":138743370,"number":149,"title":"Filtered Stream Stop Causing Exceptions","user":{"login":"PierreJC","id":9954621,"avatar_url":"https://avatars.githubusercontent.com/u/9954621?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreJC","html_url":"https://github.com/PierreJC","followers_url":"https://api.github.com/users/PierreJC/followers","following_url":"https://api.github.com/users/PierreJC/following{/other_user}","gists_url":"https://api.github.com/users/PierreJC/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreJC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreJC/subscriptions","organizations_url":"https://api.github.com/users/PierreJC/orgs","repos_url":"https://api.github.com/users/PierreJC/repos","events_url":"https://api.github.com/users/PierreJC/events{/privacy}","received_events_url":"https://api.github.com/users/PierreJC/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/linvi/tweetinvi/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/linvi/tweetinvi/labels/help%20wanted","name":"help wanted","color":"e6e6e6"}],"state":"open","locked":false,"assignee":{"login":"linvi","id":6107439,"avatar_url":"https://avatars.githubusercontent.com/u/6107439?v=3","gravatar_id":"","url":"https://api.github.com/users/linvi","html_url":"https://github.com/linvi","followers_url":"https://api.github.com/users/linvi/followers","following_url":"https://api.github.com/users/linvi/following{/other_user}","gists_url":"https://api.github.com/users/linvi/gists{/gist_id}","starred_url":"https://api.github.com/users/linvi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linvi/subscriptions","organizations_url":"https://api.github.com/users/linvi/orgs","repos_url":"https://api.github.com/users/linvi/repos","events_url":"https://api.github.com/users/linvi/events{/privacy}","received_events_url":"https://api.github.com/users/linvi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/linvi/tweetinvi/milestones/4","html_url":"https://github.com/linvi/tweetinvi/milestones/Version%200.9.11.x","labels_url":"https://api.github.com/repos/linvi/tweetinvi/milestones/4/labels","id":1330253,"number":4,"title":"Version 0.9.11.x","description":"","creator":{"login":"linvi","id":6107439,"avatar_url":"https://avatars.githubusercontent.com/u/6107439?v=3","gravatar_id":"","url":"https://api.github.com/users/linvi","html_url":"https://github.com/linvi","followers_url":"https://api.github.com/users/linvi/followers","following_url":"https://api.github.com/users/linvi/following{/other_user}","gists_url":"https://api.github.com/users/linvi/gists{/gist_id}","starred_url":"https://api.github.com/users/linvi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linvi/subscriptions","organizations_url":"https://api.github.com/users/linvi/orgs","repos_url":"https://api.github.com/users/linvi/repos","events_url":"https://api.github.com/users/linvi/events{/privacy}","received_events_url":"https://api.github.com/users/linvi/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":31,"state":"open","created_at":"2015-09-30T00:14:24Z","updated_at":"2016-03-06T04:05:41Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2016-03-06T01:50:33Z","updated_at":"2016-03-11T10:17:40Z","closed_at":null,"body":"Hello,\r\n\r\nI am facing an issue with filtered streams within my C# program. I am trying to start a stream for a specific track, and then whenever the features are met, I call stop on the stream, in order to reset the stream for another track. The weird thing is that every single time I call stop on the stream, I get multiple IO first chance exceptions and a socket exception.\r\n\r\nAlso I try to override the functionality sometimes to just reset the stream for another track, by stopping the current stream and regenerating a new one, and then it would cause all these exceptions plus another web exception that stops the next stream from working.\r\n\r\nI am StartStreamMatchingAllConditionsAsync everytime I start it again.\r\nWould you be able to know what's happening here ?\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/linvi/tweetinvi/issues/comments/195308196","html_url":"https://github.com/linvi/tweetinvi/issues/149#issuecomment-195308196","issue_url":"https://api.github.com/repos/linvi/tweetinvi/issues/149","id":195308196,"user":{"login":"PierreJC","id":9954621,"avatar_url":"https://avatars.githubusercontent.com/u/9954621?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreJC","html_url":"https://github.com/PierreJC","followers_url":"https://api.github.com/users/PierreJC/followers","following_url":"https://api.github.com/users/PierreJC/following{/other_user}","gists_url":"https://api.github.com/users/PierreJC/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreJC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreJC/subscriptions","organizations_url":"https://api.github.com/users/PierreJC/orgs","repos_url":"https://api.github.com/users/PierreJC/repos","events_url":"https://api.github.com/users/PierreJC/events{/privacy}","received_events_url":"https://api.github.com/users/PierreJC/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T10:17:40Z","updated_at":"2016-03-11T10:17:40Z","body":"Hey linvi,\r\n\r\nJust wanted to tell you that after some debugging and research, it seems like this is normal behavior in our case. I tried using other libraries to replicate the issue and it still happened (Linq2Twitter for example). The issue is that those fast stops and restarts get rejected by Twitter after a couple of times. How I fixed it now is a delay of 15s between a stop and restart because it suits the purpose of my program. You might need less of a delay, but this has fixed my problem.\r\n\r\n```\r\nm_twitterInterface.StopStream();\r\nm_resetTimer.Stop();\r\n\r\nprivate void restartTimerEventHandler(object sender, ElapsedEventArgs e)\r\n{\r\n     m_resetTime.Start();\r\n}\r\n\r\n// This reset timer of course goes for 15 seconds, and on elapsed, it starts the stream again.\r\n```"}}