WebsocketNotConnectedException

未关闭
#217 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
20/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
android, java
领域
networking

调研方向

The crash comes from the send call in WebSocketConnection.java around line 132, which runs as a Runnable on the executor from Factory.java. Start by checking whether the connection state is verified before WebSocketClient.send is called, and whether a disconnect can happen between that check and the send. The issue gives no reproduction steps, so a fix would need a clear guard or handling for the not-connected case and a test that sends on a closed socket. Done means the send path no longer throws WebsocketNotConnectedException unhandled, with the behaviour confirmed by a test.

由索引模型根据 Issue 内容生成。

描述

bug

With Pusher 2.0.0
SM-G950F, Android 9

Non-fatal Exception: org.java_websocket.exceptions.WebsocketNotConnectedException
  at org.java_websocket.WebSocketImpl.send + 630(WebSocketImpl.java:630)
  at org.java_websocket.WebSocketImpl.send + 607(WebSocketImpl.java:607)
  at org.java_websocket.client.WebSocketClient.send + 344(WebSocketClient.java:344)
  at com.pusher.client.connection.websocket.WebSocketConnection$3.run + 132(WebSocketConnection.java:132)
  at com.pusher.client.util.Factory$1.run + 109(Factory.java:109)
  at java.util.concurrent.ThreadPoolExecutor.runWorker + 1167(ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run + 641(ThreadPoolExecutor.java:641)
  at java.lang.Thread.run + 764(Thread.java:764)
主要语言
Java
星标
315
派生
140
平均合并
10 天 14 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pusher/pusher-websocket-java 的其他 Issue

查看 pusher/pusher-websocket-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。