rcj6056
V2EX  ›  Android

Exception: Java .net.SocketException: Software caused connection abort

  •  
  •   rcj6056 · Oct 17, 2023 · 12742 views
    This topic created in 1129 days ago, the information mentioned may be changed or developed.

    WebSocket 连接异常

    场景:app 息屏停在后台 过几分钟之后亮屏 进入应用会出现这个异常 手机:IQOO android13

    息屏进入后台感觉是被手机系统给冻结了 导致 websocket 断链

    有没有朋友遇到过类似的情况?

    4 replies  •  2023-10-19 13:58:56 +08:00
    guyeu
    guyeu
    Oct 18, 2023 via iPhone
    1
    断网就会这样吧,问题是如何处理这个异常
    baoshijiagong
    baoshijiagong
    Oct 19, 2023
    2
    正常都会,可以在 onResume 里面检查连接重连。
    rcj6056
    rcj6056
    OP
    Oct 19, 2023
    3
    @guyeu 没有断网 现象是只要 app 处于后台 过一会后就会出现这个异常
    wifi 是好的
    rcj6056
    rcj6056
    OP
    Oct 19, 2023
    4
    @baoshijiagong 这种有啥好的处理方式?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1592 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 16:29 · PVG 00:29 · LAX 08:29 · JFK 11:29
    ♥ Do have faith in what you're doing.