syncRPC starts a server to handle synchronisation RPCs via a TCP socket.
()
| 256 | |
| 257 | // syncRPC starts a server to handle synchronisation RPCs via a TCP socket. |
| 258 | func (e *Engine) syncRPC() { |
| 259 | // TODO(jsing): Make this default to IPv6, if configured. |
| 260 | addr := &net.TCPAddr{ |
| 261 | IP: e.config.Node.IPv4Addr, |
| 262 | Port: e.config.SyncPort, |
| 263 | } |
| 264 | ln, err := net.ListenTCP("tcp", addr) |
| 265 | if err != nil { |
| 266 | log.Fatalf("Listen failed: %v", err) |
| 267 | } |
| 268 | |
| 269 | go e.syncServer.serve(ln) |
| 270 | |
| 271 | <-e.shutdownRPC |
| 272 | ln.Close() |
| 273 | e.shutdownRPC <- true |
| 274 | } |
| 275 | |
| 276 | // initNetwork initialises the network configuration for load balancing. |
| 277 | func (e *Engine) initNetwork() { |
no test coverage detected