优化代码

This commit is contained in:
刘祥超
2023-01-11 15:24:48 +08:00
parent d82c03db23
commit 5387115e4a

View File

@@ -89,6 +89,8 @@ func (this *ClientConn) Read(b []byte) (n int, err error) {
defer func() {
if err != nil {
this.lastErr = errors.New("read error: " + err.Error())
} else {
this.lastErr = nil
}
}()
}
@@ -149,6 +151,8 @@ func (this *ClientConn) Write(b []byte) (n int, err error) {
defer func() {
if err != nil {
this.lastErr = errors.New("write error: " + err.Error())
} else {
this.lastErr = nil
}
}()
}