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

Function Serve

ssh.go:91–99  ·  view source on GitHub ↗

Serve accepts incoming SSH connections on the listener l, creating a new connection goroutine for each. The connection goroutines read requests and then calls handler to handle sessions. Handler is typically nil, in which case the DefaultHandler is used.

(l net.Listener, handler Handler, options ...Option)

Source from the content-addressed store, hash-verified

89// then calls handler to handle sessions. Handler is typically nil, in which
90// case the DefaultHandler is used.
91func Serve(l net.Listener, handler Handler, options ...Option) error {
92 srv := &Server{Handler: handler}
93 for _, option := range options {
94 if err := srv.SetOption(option); err != nil {
95 return err
96 }
97 }
98 return srv.Serve(l)
99}
100
101// ListenAndServe listens on the TCP network address addr and then calls Serve
102// with handler to handle sessions on incoming connections. Handler is typically

Callers

nothing calls this directly

Calls 2

SetOptionMethod · 0.95
ServeMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…