MCPcopy
hub / github.com/gliderlabs/ssh / Close

Method Close

server.go:192–203  ·  view source on GitHub ↗

Close immediately closes all active listeners and all active connections. Close returns any error returned from closing the Server's underlying Listener(s).

()

Source from the content-addressed store, hash-verified

190// Close returns any error returned from closing the Server's
191// underlying Listener(s).
192func (srv *Server) Close() error {
193 srv.mu.Lock()
194 defer srv.mu.Unlock()
195
196 srv.closeDoneChanLocked()
197 err := srv.closeListenersLocked()
198 for c := range srv.conns {
199 c.Close()
200 delete(srv.conns, c)
201 }
202 return err
203}
204
205// Shutdown gracefully shuts down the server without interrupting any
206// active connections. Shutdown works by first closing all open

Callers 15

TestServerCloseFunction · 0.95
SftpHandlerFunction · 0.95
DirectTCPIPHandlerFunction · 0.45
HandleSSHRequestMethod · 0.45
ServeMethod · 0.45
HandleConnMethod · 0.45
closeListenersLockedMethod · 0.45
newClientSessionFunction · 0.45
TestPtyResizeFunction · 0.45
ExitMethod · 0.45
sampleSocketServerFunction · 0.45

Calls 2

closeDoneChanLockedMethod · 0.95
closeListenersLockedMethod · 0.95

Tested by 5

TestServerCloseFunction · 0.76
newClientSessionFunction · 0.36
TestPtyResizeFunction · 0.36
sampleSocketServerFunction · 0.36