MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / Kill

Method Kill

agentprotocol/server.go:700–718  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

698}
699
700func (c *ForwardCtx) Kill() {
701 if !c.stopped {
702 _ = c.NoMoreConnections()
703 }
704 for _, conn := range c.connMap {
705 _ = conn.Close()
706 }
707 t := make(chan struct{})
708 go func() {
709 select {
710 case <-t:
711 case <-time.After(5 * time.Second):
712 for _, conn := range c.connMap {
713 _ = conn.CloseImm()
714 }
715 }
716 }()
717 c.WaitFinish()
718}

Callers 2

TestConnectionSetupFunction · 0.95
OnShutdownMethod · 0.80

Calls 4

NoMoreConnectionsMethod · 0.95
WaitFinishMethod · 0.95
CloseImmMethod · 0.80
CloseMethod · 0.65

Tested by 1

TestConnectionSetupFunction · 0.76