MCPcopy
hub / github.com/tailscale/tailscale / Close

Method Close

tsnet/tsnet.go:602–612  ·  view source on GitHub ↗

Close stops the server. It must not be called before or concurrently with Start.

()

Source from the content-addressed store, hash-verified

600//
601// It must not be called before or concurrently with Start.
602func (s *Server) Close() error {
603 didClose := false
604 s.closeOnce.Do(func() {
605 didClose = true
606 s.close()
607 })
608 if !didClose {
609 return fmt.Errorf("tsnet: %w", net.ErrClosed)
610 }
611 return nil
612}
613
614func (s *Server) close() {
615 // Close listeners under s.mu, then release before the heavy shutdown

Callers 15

startServerFunction · 0.95
TestDialBlocksFunction · 0.95
TestTailscaleIPsFunction · 0.95
setupTwoClientTestFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
TestServePostRoutesFunction · 0.95
testControlHTTPFunction · 0.95
runDialPlanTestFunction · 0.95

Calls 3

closeMethod · 0.95
DoMethod · 0.65
ErrorfMethod · 0.65

Tested by 15

startServerFunction · 0.76
TestDialBlocksFunction · 0.76
TestTailscaleIPsFunction · 0.76
setupTwoClientTestFunction · 0.76
TestServePostRoutesFunction · 0.76
testControlHTTPFunction · 0.76
runDialPlanTestFunction · 0.76
TestTsmpPingFunction · 0.76
TestHandlerFunction · 0.76
TestRegisterWithoutKeyFunction · 0.76