Is there a way to manually set the ApplicationSession network timeout for Android Chromecasting?

只谈情不闲聊 提交于 2019-12-12 11:35:46

问题


I'm sending a MediaProtocolMessageStream.loadMedia command to my receiver. After a few seconds my session ends with a "network I/O timeout" with channel=SessionError.CATEGORY_DISCONNECT_CHANNEL and code=SessionError.CODE_TIMEOUT. This only happens for longer videos in the range of over 200 minutes so I'm assuming there's a legitimate timeout going on. Is there anyway to tweak the timeout time in a session so I can load larger movies? I see there's a final DEFAULT_TIMEOUT in the underlying NetworkRequest, but I have no way of accessing it.


回答1:


Timeout value cannot be adjusted by application. It would help us to understand what is causing the timeout in your case. Timeout happens when either the sender does not reply to the receiver's ping requests in a timely manner, or when the sender has not received a ping from the receiver for a certain length of time. It might be the case that the media you are trying to load is tying up the CPU on the receiver so that it can't send its ping request to the sender. Do you see anything in the sender's log similar to "timeout waiting for ping" or so?



来源:https://stackoverflow.com/questions/19778644/is-there-a-way-to-manually-set-the-applicationsession-network-timeout-for-androi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!