222twotwotwo commented on code in PR #140:
URL: https://github.com/apache/dubbo-getty/pull/140#discussion_r3768890544
##########
client.go:
##########
@@ -399,18 +391,20 @@ func (c *client) connect() {
c.Lock()
if c.ssMap == nil {
c.Unlock()
- break
+ ss.Close()
+ return false
}
c.ssMap[ss] = struct{}{}
c.Unlock()
ss.SetAttribute(sessionClientKey, c)
ss.SetAttribute(ignoreReconnectKey, false)
- break
+ return true
}
// don't distinguish between tcp connection and websocket
connection. Because
// gorilla/websocket/conn.go:(Conn)Close also invoke
net.Conn.Close()
_ = ss.Conn().Close()
}
+ return false
Review Comment:
收到,将connect()从内部循环改为单次尝试,并补充测试
##########
client.go:
##########
@@ -399,18 +391,20 @@ func (c *client) connect() {
c.Lock()
if c.ssMap == nil {
c.Unlock()
- break
+ ss.Close()
+ return false
}
c.ssMap[ss] = struct{}{}
c.Unlock()
ss.SetAttribute(sessionClientKey, c)
ss.SetAttribute(ignoreReconnectKey, false)
- break
+ return true
}
// don't distinguish between tcp connection and websocket
connection. Because
// gorilla/websocket/conn.go:(Conn)Close also invoke
net.Conn.Close()
_ = ss.Conn().Close()
}
+ return false
Review Comment:
收到,已将connect()从内部循环改为单次尝试,并补充测试
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]