MCPcopy Index your code
hub / github.com/coder/coder / Serve

Method Serve

cli/server.go:2715–2730  ·  view source on GitHub ↗

Serve acts just like http.Serve. It is a blocking call until the server is closed, and an error is returned if any underlying Serve call fails.

(srv *http.Server)

Source from the content-addressed store, hash-verified

2713// Serve acts just like http.Serve. It is a blocking call until the server
2714// is closed, and an error is returned if any underlying Serve call fails.
2715func (s *HTTPServers) Serve(srv *http.Server) error {
2716 eg := errgroup.Group{}
2717 if s.HTTPListener != nil {
2718 eg.Go(func() error {
2719 defer s.Close() // close all listeners on error
2720 return srv.Serve(s.HTTPListener)
2721 })
2722 }
2723 if s.TLSListener != nil {
2724 eg.Go(func() error {
2725 defer s.Close() // close all listeners on error
2726 return srv.Serve(s.TLSListener)
2727 })
2728 }
2729 return eg.Wait()
2730}
2731
2732func (s *HTTPServers) Close() {
2733 if s.HTTPListener != nil {

Callers 11

ServeFunction · 0.45
ServerMethod · 0.45
serveSSHForGitSSHFunction · 0.45
ServeConnV2Method · 0.45
NewFunction · 0.45
proxyServerMethod · 0.45
TestInstallFunction · 0.45
startAPIServerMethod · 0.45
startAPIServerMethod · 0.45

Calls 3

CloseMethod · 0.95
GoMethod · 0.80
WaitMethod · 0.65

Tested by 3

serveSSHForGitSSHFunction · 0.36
TestInstallFunction · 0.36