优化代码

This commit is contained in:
GoEdgeLab
2023-01-11 15:24:48 +08:00
parent 0b42e81054
commit 696c073d44

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
}
}()
}