MCPcopy
hub / github.com/bradfitz/gomemcache / Close

Method Close

memcache/memcache.go:836–849  ·  view source on GitHub ↗

Close closes any open connections. It returns the first error encountered closing connections, but always closes all connections. After Close, the Client may still be used.

()

Source from the content-addressed store, hash-verified

834//
835// After Close, the Client may still be used.
836func (c *Client) Close() error {
837 c.mu.Lock()
838 defer c.mu.Unlock()
839 var ret error
840 for _, conns := range c.freeconn {
841 for _, c := range conns {
842 if err := c.nc.Close(); err != nil && ret == nil {
843 ret = err
844 }
845 }
846 }
847 c.freeconn = nil
848 return ret
849}

Callers 7

serveMethod · 0.80
condReleaseMethod · 0.80
putFreeConnMethod · 0.80
TestLocalhostFunction · 0.80
TestFakeServerFunction · 0.80
TestTLSFunction · 0.80
BenchmarkOnItemFunction · 0.80

Calls

no outgoing calls

Tested by 5

serveMethod · 0.64
TestLocalhostFunction · 0.64
TestFakeServerFunction · 0.64
TestTLSFunction · 0.64
BenchmarkOnItemFunction · 0.64