我在开发分支。
我稍微修改了EchoBot
,下面是更改/添加的代码,否则我从源代码中包含的示例中选择了其余部分:
self.add_event_handler("session_start", self.start)
self.add_event_handler("changed_status", self.change)
...
def start(self, event):
self.send_presence(pshow='xa' , ppriority="0")
self.get_roster()
def change(self, event):
#This is django stuff, essentially what I am trying to do is log info from changed_status events
c = Change(jid = event['from'], timestamp = timezone.now(), new_availability = event['type'], new_priority = event['priority'])
c.save()
我无法让这个开始一段时间,然后在重新启动后它工作了大约一个小时,然后看似无处不在,发生了同样的错误。接下来发生的事情基本上是一个连接循环,然后是另一个导致断开连接的XML流错误......
ERROR Error reading from XML stream.
DEBUG reconnecting...
DEBUG SEND (IMMED):
INFO Waiting for from server
DEBUG ==== TRANSITION connected -> disconnected
DEBUG connecting...
DEBUG Waiting 1.84108932156 seconds before connecting.
DEBUG Connecting to xx.xxx.xxx.xxx:xxxx
DEBUG ==== TRANSITION disconnected -> connected
DEBUG SEND (IMMED):
DEBUG RECV: X-GOOGLE-TOKENX-OAUTH2
DEBUG SEND (IMMED):
DEBUG RECV:
DEBUG Starting TLS
INFO Negotiating TLS
INFO Using SSL version: 3
如果我尝试从EchoBot
运行echo_client.py
,则发生此错误后,我会遇到connecting to xx.xxx.xxx.xxx:xxxx
。
如果我再次运行我的EchoBot
版本,它会开始正常工作,但我担心会再次出现其他错误。
可能相关:
*连接到Google Talk
*还通过我的浏览器登录到Gmail
*还在我的Android上登录Google Talk
我的问题是如何解决这个错误,或者如何处理它并正确处理它?</ p>