svnno****@sourc*****
svnno****@sourc*****
2010年 11月 25日 (木) 09:15:09 JST
Revision: 1111 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1111 Author: syo68k Date: 2010-11-25 09:15:09 +0900 (Thu, 25 Nov 2010) Log Message: ----------- ・タイムアウトの際のリトライが効いていなかったのを修正 ・Startedイベントを起こすタイミングの見直し ・UserStreamEnabledプロパティをReadOnlyに Modified Paths: -------------- branches/UserStream/Tween/Twitter.vb -------------- next part -------------- Modified: branches/UserStream/Tween/Twitter.vb =================================================================== --- branches/UserStream/Tween/Twitter.vb 2010-11-24 14:10:15 UTC (rev 1110) +++ branches/UserStream/Tween/Twitter.vb 2010-11-25 00:15:09 UTC (rev 1111) @@ -2754,13 +2754,10 @@ Private Sub Twitter_ApiInformationChanged(ByVal sender As Object, ByVal e As ApiInformationChangedEventArgs) Handles Me.ApiInformationChanged End Sub - Public Property UserStreamEnabled As Boolean + Public ReadOnly Property UserStreamEnabled As Boolean Get Return _streamActive End Get - Set(ByVal value As Boolean) - _streamActive = value - End Set End Property Public Sub StartUserStream() @@ -2771,7 +2768,6 @@ _streamThread.IsBackground = True _streamActive = True _streamThread.Start() - RaiseEvent UserStreamStarted() End Sub Public Sub StopUserStream() @@ -2803,6 +2799,7 @@ isRetry = False twCon.UserStream(st) sr = New StreamReader(st) + RaiseEvent UserStreamStarted() Do While _streamActive Dim line As String = sr.ReadLine() If _streamBypass OrElse String.IsNullOrEmpty(line) Then Continue Do @@ -2851,6 +2848,7 @@ RaiseEvent UserStreamStopped() If isRetry Then Thread.Sleep(10 * 1000) + _streamActive = True End If End Try Loop While isRetry