rcj6056
V2EX  ›  Android

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

  •  
  •   rcj6056 · Oct 17, 2023 · 11969 views
    This topic created in 964 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
        1
    guyeu  
       Oct 18, 2023 via iPhone
    断网就会这样吧,问题是如何处理这个异常
    baoshijiagong
        2
    baoshijiagong  
       Oct 19, 2023
    正常都会,可以在 onResume 里面检查连接重连。
    rcj6056
        3
    rcj6056  
    OP
       Oct 19, 2023
    @guyeu 没有断网 现象是只要 app 处于后台 过一会后就会出现这个异常
    wifi 是好的
    rcj6056
        4
    rcj6056  
    OP
       Oct 19, 2023
    @baoshijiagong 这种有啥好的处理方式?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1183 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:41 · PVG 07:41 · LAX 16:41 · JFK 19:41
    ♥ Do have faith in what you're doing.