AlexStocks / getty

a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Apache License 2.0
883 stars 184 forks source link

服务端关闭连接时,客户端异常关闭 #73

Closed Jardaliao closed 7 months ago

Jardaliao commented 7 months ago

What happened: 服务端主动关闭连接时,返回的错误码及错误信息异常

image image

What you expected to happen:客户端得到正确的错误码和错误信息

How to reproduce it (as minimally and precisely as possible): 使用master分支的代码,服务端主动关闭连接,100%出现

Anything else we need to know?:

AlexStocks commented 7 months ago

@Jardaliao thank you for your contribution. I have merge your pr and draft a new release v1.3.2.

What's more, I hope you can submit a ut for your PR.

And please attention that : image

if code < 1000 || code > 1015 {
  return fmt.Errorf("invalid close code: %d", code)
 }