func NewNodeDaemon(bindAddr string) (*NodeDaemon, error) { us := NodeID(fmt.Sprint(time.Now().UnixNano())) // XXX l, err := net.Listen("tcp", bindAddr) if err != nil { return nil, err } nd := &NodeDaemon{ us: us, listener: l, connectivity: propagation.NewConnectivity(us), } go nd.acceptConnections() return nd, nil }
func NewNodeDaemon(bindAddr string) (*NodeDaemon, error) { us := newNodeID() l, err := net.Listen("tcp", bindAddr) if err != nil { return nil, err } nd := &NodeDaemon{ us: us, listener: l, connectivity: propagation.NewConnectivity(us), } go nd.acceptConnections() return nd, nil }