mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:10:56 +00:00
add isclose call close many times
This commit is contained in:
parent
aa9cb6d052
commit
573df2e747
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user