MCPcopy Create free account
hub / github.com/ethstorage/es-node / Close

Method Close

ethstorage/p2p/node.go:286–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284}
285
286func (n *NodeP2P) Close() error {
287 var result *multierror.Error
288 if n.dv5Udp != nil {
289 n.dv5Udp.Close()
290 }
291 // if n.gsOut != nil {
292 // if err := n.gsOut.Close(); err != nil {
293 // result = multierror.Append(result, fmt.Errorf("failed to close gossip cleanly: %w", err))
294 // }
295 // }
296 if n.host != nil {
297 if err := n.host.Close(); err != nil {
298 result = multierror.Append(result, fmt.Errorf("failed to close p2p host cleanly: %w", err))
299 }
300 if n.syncCl != nil {
301 if err := n.syncCl.Close(); err != nil {
302 result = multierror.Append(result, fmt.Errorf("failed to close p2p sync client cleanly: %w", err))
303 }
304 }
305 if n.syncSrv != nil {
306 n.syncSrv.Close()
307 }
308 }
309 return result.ErrorOrNil()
310}
311
312func FindActiveTCPPort(h host.Host) (uint16, error) {
313 var tcpPort uint16

Callers 2

NewNodeP2PFunction · 0.95
RequestShardListMethod · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected