Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
c701b6c4
Commit
c701b6c4
authored
Aug 19, 2013
by
Timo Ewalds
Browse files
Default is just to do nothing and let it reconnect
parent
48a3b52d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
c701b6c4
...
...
@@ -2,7 +2,6 @@
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import
logging
import
httplib
from
socket
import
timeout
from
threading
import
Thread
...
...
@@ -80,22 +79,10 @@ class StreamListener(object):
def
on_disconnect
(
self
,
notice
):
"""Called when twitter sends a disconnect notice
All d
isconnect codes are listed here:
D
isconnect codes are listed here:
https://dev.twitter.com/docs/streaming-apis/messages#Disconnect_messages_disconnect
"""
if
notice
[
'code'
]
in
(
2
,
# duplicate stream
3
,
# control request, shut down by control stream
5
,
# shut down by this client
6
,
# token revoked, auth will fail next time
7
,
# admin logout, connected elsewhere
9
,
# max message limit
):
logging
.
info
(
"Disconnect notice code %s received, disconnecting"
,
notice
[
'code'
])
return
False
else
:
# reconnect
logging
.
info
(
"Disconnect notice code %s received, reconnecting"
,
notice
[
'code'
])
return
return
class
Stream
(
object
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment