1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 20:51:29 +00:00

add isclose call close many times

This commit is contained in:
astaxie 2013-06-26 22:13:25 +08:00
parent aa9cb6d052
commit 573df2e747

View File

@ -28,11 +28,15 @@ var ErrInitStart = errors.New("init from")
type conn struct {
net.Conn
wg *sync.WaitGroup
isclose bool
}
func (c conn) Close() error {
err := c.Conn.Close()
if !c.isclose {
c.wg.Done()
c.isclose = true
}
return err
}