首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android,Firebase登录时间稍长,WebSocketException发生

Android,Firebase登录时间稍长,WebSocketException发生
EN

Stack Overflow用户
提问于 2016-01-06 13:37:02
回答 2查看 1.2K关注 0票数 2

我使用authWithCustomToken方法使用Firebase登录。登录大约需要5秒或更长时间。我启用了Firebase日志(setLogLevel(Logger.Level.DEBUG))来监视是否存在任何问题。Log在这里(我稍微修剪了一下,如果需要的话,我可以为它提供一个链接):

PS: android firebase客户端版本为2.5.0

代码语言:javascript
复制
ws_0 - websocket opened
conn_0 - Got control message: {t=r, d=s-softlayer.firebaseio.com}
conn_0 - Got a reset; killing connection to tbf.firebaseio.com; Updating internalHost to s-softlayer.firebaseio.com
conn_0 - closing realtime connection
handleIncomingFrame complete frame: {d={t=r, d=s-softlayer.firebaseio.com}, t=c}
ws_0 - websocket is being closed
ws_0 - had an error
    com.firebase.tubesock.WebSocketException: IO Error
        at com.firebase.tubesock.WebSocketReceiver.run(WebSocketReceiver.java:78)
        at com.firebase.tubesock.WebSocket.runReader(WebSocket.java:372)
        at com.firebase.tubesock.WebSocket.access$000(WebSocket.java:30)
        at com.firebase.tubesock.WebSocket$2.run(WebSocket.java:108)
        at java.lang.Thread.run(Thread.java:818)
    Caused by: java.io.EOFException
        at libcore.io.Streams.readFully(Streams.java:83)
        at java.io.DataInputStream.readFully(DataInputStream.java:99)
        at com.firebase.tubesock.WebSocketReceiver.read(WebSocketReceiver.java:141)
        at com.firebase.tubesock.WebSocketReceiver.run(WebSocketReceiver.java:34)
        at com.firebase.tubesock.WebSocket.runReader(WebSocket.java:372) 
        at com.firebase.tubesock.WebSocket.access$000(WebSocket.java:30) 
        at com.firebase.tubesock.WebSocket$2.run(WebSocket.java:108) 
        at java.lang.Thread.run(Thread.java:818) 

ws_0 - |IO Error|
ws_0 - closed

conn_1 - Opening a connection
ws_1 - websocket opened
ws_1 - handleIncomingFrame complete frame: {d={t=r, d=s-dal5-nss-19.firebaseio.com}, t=c}
conn_1 - Got control message: {t=r, d=s-dal5-nss-19.firebaseio.com}
conn_1 - Got a reset; killing connection to s-softlayer.firebaseio.com; Updating internalHost to s-dal5-nss-19.firebaseio.com
conn_1 - closing realtime connection
ws_1 - websocket is being closed
ws_1 - had an error
    com.firebase.tubesock.WebSocketException: IO Error
        at com.firebase.tubesock.WebSocketReceiver.run(WebSocketReceiver.java:78)
        ...
    Caused by: java.io.EOFException
        at libcore.io.Streams.readFully(Streams.java:83)
        ...

ws_1 - |IO Error|
ws_1 - closed
conn_2 - Opening a connection
ws_1 - had an error
    com.firebase.tubesock.WebSocketException: IO Exception
    ...
ws_1 - |IO Exception|
ws_2 - websocket opened
conn_2 - Got control message: {t=h, d={ts=1452086065546, v=5, h=s-dal5-nss-19.firebaseio.com, s=EaQhQ7iRAjeWVxvzBJEFD7k4TKFsmrms}}
conn_2 - realtime connection established

这个日志是说有错误吗?

我应该忽略它吗?如果是,为什么登录时间太长?

EN

回答 2

Stack Overflow用户

发布于 2016-01-06 15:18:34

输出中没有确定任何定时影响的信息。但据我所知,水流看起来很正常。你的前两个连接被重定向了。然后,第三个连接到达正确的服务器,服务器用“建立实时连接”进行响应。

票数 3
EN

Stack Overflow用户

发布于 2016-01-19 13:35:31

问题是在keepSynced(true)行之后进行身份验证。同步节点有大约250 has的数据。我认为同步数据会阻止我的身份验证。另一方面,firebase不能同步节点,因为它必须进行身份验证才能读取节点。(看起来像是死锁)我不知道实际原因是什么,但删除keepSynced(true)行解决了我目前的问题。

代码语言:javascript
复制
Firebase ref = new Firebase("my_firebase_url");
ref.child("matches").keepSynced(true); // removed this line
ref.authWithCustomToken(...);
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34634483

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档