MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / RunServer

Function RunServer

worker/worker.go:94–110  ·  view source on GitHub ↗

RunServer initializes a tcp server on port which listens to requests from other workers for pb.communication.

(bindall bool)

Source from the content-addressed store, hash-verified

92// RunServer initializes a tcp server on port which listens to requests from
93// other workers for pb.communication.
94func RunServer(bindall bool) {
95 laddr := "localhost"
96 if bindall {
97 laddr = "0.0.0.0"
98 }
99 ln, err := net.Listen("tcp", fmt.Sprintf("%s:%d", laddr, workerPort()))
100 if err != nil {
101 log.Fatalf("While running server: %v", err)
102 }
103 glog.Infof("Worker listening at address: %v", ln.Addr())
104
105 pb.RegisterWorkerServer(workerServer, &grpcWorker{})
106 pb.RegisterRaftServer(workerServer, &raftServer)
107 if err := workerServer.Serve(ln); err != nil {
108 glog.Errorf("Error while calling Serve: %+v", err)
109 }
110}
111
112// StoreStats returns stats for data store.
113func StoreStats() string {

Callers 1

setupServerFunction · 0.92

Calls 6

RegisterWorkerServerFunction · 0.92
RegisterRaftServerFunction · 0.92
workerPortFunction · 0.85
FatalfMethod · 0.80
InfofMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected