netty-websocket-spring-boot-starter icon indicating copy to clipboard operation
netty-websocket-spring-boot-starter copied to clipboard

关于断网后不会进入onClose或者onError的问题

Open Lc-1995 opened this issue 4 years ago • 4 comments

作者你好,我测试中如果设备没有网了,服务端这边是不会进入close或者error的,出现假连接的情况,那就无法判断连接是否已经断开了,请问这个有什么办法处理吗?中间使用nginx。

Lc-1995 avatar Dec 23 '20 03:12 Lc-1995

没有网是什么情况 因为连接是基于TCP,如果TCP判断不出来close,就不会进入close方法。

YeautyYE avatar Dec 23 '20 04:12 YeautyYE

没有网是什么情况 因为连接是基于TCP,如果TCP判断不出来close,就不会进入close方法。

比如wifi信号不好,或者直接断开,流量卡没有流量等情况出现的没有网的情况。

Lc-1995 avatar Dec 23 '20 04:12 Lc-1995

没有网是什么情况 因为连接是基于TCP,如果TCP判断不出来close,就不会进入close方法。

另外除开这个问题,中间使用了nginx的话,需要对nginx设置些什么吗?

Lc-1995 avatar Dec 23 '20 05:12 Lc-1995

不是有读写空闲事件吗

minson1994 avatar Apr 20 '21 09:04 minson1994