Ejemplo n.º 1
0
func main() {
	hostname, _ := os.Hostname()
	flag.Parse()
	if *selfAddr == "" {
		*selfAddr = hostname + ":9032"
	}
	if *webAddr == "" {
		*webAddr = hostname + ":8000"
	}
	fmt.Printf("Starting server. targetAddr = %s, selfAddr = %s, webAddr = %s\n", *targetAddr, *selfAddr, *webAddr)
	runtime.GOMAXPROCS(2)
	cl = chordlib.NewChordLibrary(*selfAddr, *targetAddr, uint32(*nodeID))
	go webServer()
	cl.CommandLineDebug()
}
Ejemplo n.º 2
0
func startNewChordServer(host, addr string) *chordlib.ChordLibrary {
	log.Printf("Starting server on %s\n", addr)
	return chordlib.NewChordLibrary(addr, host, 0)
}