一直连不上,不执行回调函数,至少要有个超时的回调吧?

01-29 17:28:48.629 14863-14863/com.trophytech.yoyo D/com.avos.avoscloud.PushService: PushService->onStartCommand->142: Start to connect to push server with installationId 07237eb7fca51f431fcd19eb924213d7
01-29 17:28:48.632 14863-14863/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://docker-test.leancloud.cn:6799/ from master server
01-29 17:29:42.772 14863-14863/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://docker-test.leancloud.cn:6799/ from secondary server.
01-29 17:29:42.793 14863-14863/com.trophytech.yoyo D/com.avos.avoscloud.PushService: PushService->onStartCommand->142: Start to connect to push server with installationId 07237eb7fca51f431fcd19eb924213d7
01-29 17:29:42.800 14863-14863/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://docker-test.leancloud.cn:6799/ from secondary server.
01-29 17:30:42.821 14863-14863/com.trophytech.yoyo D/com.avos.avoscloud.PushService: PushService->onStartCommand->142: Start to connect to push server with installationId 07237eb7fca51f431fcd19eb924213d7
01-29 17:30:42.879 14863-23533/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: {"groupId":"g0","server":"wss:\/\/cn-n1-cell3.leancloud.cn:6799\/","ttl":3600,"secondary":"wss:\/\/rtm53.leancloud.cn:6799\/"}
01-29 17:30:42.881 14863-23532/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: {"groupId":"g0","server":"wss:\/\/rtm53.leancloud.cn:6799\/","ttl":3600,"secondary":"wss:\/\/cn-n1-cell1.leancloud.cn:6799\/"}
01-29 17:30:42.905 14863-23532/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm53.leancloud.cn:6799/ from master server
01-29 17:30:42.916 14863-23533/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://cn-n1-cell3.leancloud.cn:6799/ from master server
01-29 17:31:42.830 14863-14863/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm53.leancloud.cn:6799/ from secondary server.
01-29 17:31:42.835 14863-14863/com.trophytech.yoyo D/com.avos.avoscloud.PushService: PushService->onStartCommand->142: Start to connect to push server with installationId 07237eb7fca51f431fcd19eb924213d7
01-29 17:31:42.843 14863-14863/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm53.leancloud.cn:6799/ from secondary server.

您好,能在相同的网络环境下执行一下

telnet rtm53.leancloud.cn 6799

吗,看能否连上

你好,什么时候出现这种情况?之前是正常的吗?

bogon:~ mabo$ telnet rtm53.leancloud.cn 6799
Trying 123.59.40.5...
Connected to rtm53.leancloud.cn.
Escape character is '^]'.

最近一直这样,sdk是3.12.3的。连不上时他会自己一直重试,也没有超时机制,回调都不执行,也不抛出异常.

最近聊天服务连接也超级不稳定,感觉判断是否连线非常不准确(也就是说连接断了,还是connected的状态)。

从我的分析来看,你出现这些日志应该是一直在尝试重连。所以这种情况并不是你所说的“连接断了,还是connected的状态”,而是不断地重试。

关于超时的问题,如果是你使用AVIMClient进行操作的话,从代码逻辑上来说遇到这种不断重连的情况,我们是会有超时异常的,没有报错倒是有点诡异。

你这种场景来说,比较常见的场景是客户端连接我们的聊天服务器有问题,你确定你的电脑和测试手机都是走的同一个网络么?手机上是否设置了代理?(并不是质疑,只是排查的步骤)

手机和电脑是同一个网络。偶尔他就自动好了,我也不知道原因,深表疑惑。

我们APP的代码没有循环不断自动重连的逻辑呀。

建议你们自己写个循环测试看看是否会超时?是不是和你们的服务器不稳定有关?

今天又有新的情况,手机放着不动,然后连接就自己断开了,日志如下:

02-01 13:27:36.500 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.504 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.507 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.509 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.518 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.521 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.525 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.534 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.535 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:27:36.547 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.347 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.350 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.352 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.355 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.359 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.362 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.366 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.373 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.376 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server
02-01 13:29:56.382 32658-32658/com.trophytech.yoyo D/===AVOS Cloud===: LogUtil$avlog->d->28: get push server:wss://rtm55.leancloud.cn:6799/ from master server