简体   繁体   English

在autobahn python中自动重新连接

[英]Auto-reconnect in autobahn python

In autobahn python, it seems like if my initial connection failed there's no way to tell, or any callbacks that I can override in my WampClientProtocol subclass. 在autobahn python中,似乎我的初始连接失败了,无法告诉我,或者我可以在我的WampClientProtocol子类中覆盖的任何回调。 I tried overriding clientConnectionFailed , but it didn't get called when the connection failed. 我尝试覆盖clientConnectionFailed ,但是在连接失败时没有调用它。

The only output I get when the connection failed is 连接失败时唯一的输出是

2013-09-29 22:17:50-0500 [Uninitialized] Stopping factory <autobahn.wamp.WampClientFactory instance at 0x20ee758>
2013-09-29 22:17:50-0500 [Uninitialized] WebSocketClientFactory stopped

原来这不是特定于AutobahnPython的 - 处理这个Twisted方式是覆盖clientConnectionFailed (初始连接已经失败......“主机无法访问”等)和/或clientConnectionLost (曾经有一个连接丢失了......或者clientConnectionLost关闭)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM