简体   繁体   English

Android Websocket 连接失败(Galaxy s4)

[英]Android Websocket connection failed (Galaxy s4)

I'm facing strange bug.我正面临着奇怪的错误。 We have an Android application that uses java websockets 1.3.0.我们有一个使用 java websockets 1.3.0 的 Android 应用程序。

From any devices or emulators websocket works perfectly, but not on mine Samsung Galaxy S4.从任何设备或模拟器 websocket 都可以完美运行,但在我的三星 Galaxy S4 上却不能。 When I try to send a message through websocket, application crashes with an exception:当我尝试通过 websocket 发送消息时,应用程序崩溃并出现异常:

Fatal Exception: main
Process: ru.app, PID: 22920
org.java_websocket.exceptions.WebSocketNotConnectedException
at ...

Can you suggest any clue of where to look?你能提出任何关于在哪里看的线索吗? I suppose that there is no problems with code, but with device.我想代码没有问题,但设备有问题。 But I can provide parts of code if needed.但如果需要,我可以提供部分代码。

I have also tried to connect to different network without any success.我也尝试连接到不同的网络,但没有成功。

Can you please give me just a hint?你能给我一个提示吗? What it that?那是什么?

Big thanks!十分感谢!

There was a report that URI.getHost() method on some Samsung devices returns null .有报告称某些三星设备上的URI.getHost()方法返回null

App Crashes on Samsung S3/S4 API 18/21 when opening web socket with hostname 使用主机名打开 Web 套接字时,Samsung S3/S4 API 18/21 上的应用程序崩溃

The workaround I added to my WebSocket client library ( nv-websocket-client ) is this .我添加到我的 WebSocket 客户端库 ( nv-websocket-client ) 的解决方法是这样的

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

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