modify close old connect connection logic

This commit is contained in:
zhouyuyan
2017-10-26 15:57:19 +08:00
parent eeab0c6b7d
commit a7fb7f1912
2 changed files with 21 additions and 9 deletions

View File

@@ -35,6 +35,7 @@ type client struct {
route *route
status int
smu sync.RWMutex
mp *MessagePool
subs map[string]*subscription
rsubs map[string]*subInfo
}
@@ -84,8 +85,9 @@ func (c *client) init() {
c.info.remoteIP = strings.Split(c.conn.RemoteAddr().String(), ":")[0]
}
func (c *client) readLoop(msgPool *MessagePool) {
func (c *client) readLoop() {
nc := c.conn
msgPool := c.mp
if nc == nil || msgPool == nil {
return
}