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

Method Serve

rpc/server.go:101–117  ·  view source on GitHub ↗

Serve start the Server main loop,.

()

Source from the content-addressed store, hash-verified

99
100// Serve start the Server main loop,.
101func (s *Server) Serve() {
102serverLoop:
103 for {
104 select {
105 case <-s.ctx.Done():
106 log.Info("stopping Server Loop")
107 break serverLoop
108 default:
109 conn, err := s.Listener.Accept()
110 if err != nil {
111 continue
112 }
113 log.WithField("remote", conn.RemoteAddr().String()).Info("accept")
114 go s.serveConn(conn)
115 }
116 }
117}
118
119func (s *Server) serveConn(conn net.Conn) {
120 le := log.WithField("remote_addr", conn.RemoteAddr())

Callers 10

TestMultiChainFunction · 0.95
TestDebugHandlerFunction · 0.95
TestServer_CloseFunction · 0.95
setupMuxParallelFunction · 0.45
initNodeChainBusServiceFunction · 0.45
initNodeFunction · 0.45
startMethod · 0.45
ServeFunction · 0.45
setupServersFunction · 0.45

Calls 7

serveConnMethod · 0.95
InfoFunction · 0.92
WithFieldFunction · 0.92
AcceptMethod · 0.80
InfoMethod · 0.80
RemoteAddrMethod · 0.80
StringMethod · 0.45

Tested by 9

TestMultiChainFunction · 0.76
TestDebugHandlerFunction · 0.76
TestServer_CloseFunction · 0.76
setupMuxParallelFunction · 0.36
initNodeChainBusServiceFunction · 0.36
initNodeFunction · 0.36
startMethod · 0.36
setupServersFunction · 0.36