MCPcopy
hub / github.com/github/gh-ost / Serve

Method Serve

go/logic/server.go:145–169  ·  view source on GitHub ↗

Serve begins listening & serving on whichever device was configured

()

Source from the content-addressed store, hash-verified

143
144// Serve begins listening & serving on whichever device was configured
145func (srv *Server) Serve() (err error) {
146 go func() {
147 for {
148 conn, err := srv.unixListener.Accept()
149 if err != nil {
150 srv.migrationContext.Log.Errore(err)
151 }
152 go srv.handleConnection(conn)
153 }
154 }()
155 go func() {
156 if srv.tcpListener == nil {
157 return
158 }
159 for {
160 conn, err := srv.tcpListener.Accept()
161 if err != nil {
162 srv.migrationContext.Log.Errore(err)
163 }
164 go srv.handleConnection(conn)
165 }
166 }()
167
168 return nil
169}
170
171func (srv *Server) handleConnection(conn net.Conn) (err error) {
172 if conn != nil {

Callers 1

initiateServerMethod · 0.80

Calls 2

handleConnectionMethod · 0.95
ErroreMethod · 0.65

Tested by

no test coverage detected