Commit 573df2e7 authored by astaxie's avatar astaxie

add isclose call close many times

parent aa9cb6d0
......@@ -27,12 +27,16 @@ var ErrInitStart = errors.New("init from")
// Allows for us to notice when the connection is closed.
type conn struct {
net.Conn
wg *sync.WaitGroup
wg *sync.WaitGroup
isclose bool
}
func (c conn) Close() error {
err := c.Conn.Close()
c.wg.Done()
if !c.isclose {
c.wg.Done()
c.isclose = true
}
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment