|
|
@ -35,6 +35,7 @@ type Conn struct { |
|
|
|
net.Conn |
|
|
|
ReadTimeout time.Duration |
|
|
|
WriteTimeout time.Duration |
|
|
|
isClosed bool |
|
|
|
} |
|
|
|
|
|
|
|
func (c *Conn) Read(b []byte) (count int, e error) { |
|
|
@ -66,7 +67,10 @@ func (c *Conn) Write(b []byte) (count int, e error) { |
|
|
|
} |
|
|
|
|
|
|
|
func (c *Conn) Close() error { |
|
|
|
stats.ConnectionClose() |
|
|
|
if !c.isClosed { |
|
|
|
stats.ConnectionClose() |
|
|
|
c.isClosed = true |
|
|
|
} |
|
|
|
return c.Conn.Close() |
|
|
|
} |
|
|
|
|
|
|
|