mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
close the connection with better accouting
This commit is contained in:
parent
978da73cdb
commit
5e8bb86995
|
@ -67,11 +67,14 @@ func (c *Conn) Write(b []byte) (count int, e error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) Close() error {
|
func (c *Conn) Close() error {
|
||||||
|
err := c.Conn.Close()
|
||||||
|
if err == nil {
|
||||||
if !c.isClosed {
|
if !c.isClosed {
|
||||||
stats.ConnectionClose()
|
stats.ConnectionClose()
|
||||||
c.isClosed = true
|
c.isClosed = true
|
||||||
}
|
}
|
||||||
return c.Conn.Close()
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewListener(addr string, timeout time.Duration) (net.Listener, error) {
|
func NewListener(addr string, timeout time.Duration) (net.Listener, error) {
|
||||||
|
|
Loading…
Reference in a new issue