连接创建后不发报文,ctx可能为空

This commit is contained in:
三丙
2025-09-13 17:03:59 +08:00
parent 7c6a1df15e
commit b660fd94c2

View File

@@ -85,8 +85,10 @@ public class TcpSession extends ProtocolSession {
public void close(SessionCloseReason reason) {
super.close(reason);
ctx.flush();
ctx.close();
if (ctx != null) {
ctx.flush();
ctx.close();
}
}
public void writeAndFlush(ByteBuf byteBuf) {