Skip to content

Commit 8e2eb0b

Browse files
committed
fix: writeControl close-frame fail caused by writeCtx canceled
1 parent 7d7c644 commit 8e2eb0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

netconn.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,13 @@ type netConn struct {
114114

115115
var _ net.Conn = &netConn{}
116116

117-
func (nc *netConn) Close() error {
117+
func (nc *netConn) Close() (err error) {
118+
err = nc.c.Close(StatusNormalClosure, "")
118119
nc.writeTimer.Stop()
119120
nc.writeCancel()
120121
nc.readTimer.Stop()
121122
nc.readCancel()
122-
return nc.c.Close(StatusNormalClosure, "")
123+
return err
123124
}
124125

125126
func (nc *netConn) Write(p []byte) (int, error) {

0 commit comments

Comments
 (0)