MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / disconnectClients

Method disconnectClients

internal/sshserver/serverImpl.go:126–139  ·  view source on GitHub ↗
(lifecycle service.Lifecycle, allClientsExited chan struct{})

Source from the content-addressed store, hash-verified

124}
125
126func (s *serverImpl) disconnectClients(lifecycle service.Lifecycle, allClientsExited chan struct{}) {
127 select {
128 case <-allClientsExited:
129 return
130 case <-lifecycle.ShutdownContext().Done():
131 }
132
133 s.lock.Lock()
134 for serverSocket := range s.clientSockets {
135 _ = serverSocket.Close()
136 }
137 s.clientSockets = map[*ssh.ServerConn]bool{}
138 s.lock.Unlock()
139}
140
141func (s *serverImpl) createPasswordAuthenticator(
142 connectionMetadata metadata.ConnectionMetadata,

Callers 1

RunWithLifecycleMethod · 0.95

Calls 2

ShutdownContextMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected