Beispiel #1
0
func main() {
	m := new(master.Master)

	flag.Parse()

	rpc.Register(m)

	l, _ := net.Listen("tcp", ":1338")
	/*if e != nil {
		log.Fatal("listen error:", e)
	}*/
	rpc.Accept(l)
	fmt.Println("done")

}
Beispiel #2
0
func main() {

	masterAddress := flag.Arg(0)

	chunkServ := new(chunk.Server)
	chunk.Init(masterAddress)
	go chunk.SendHeartbeat(masterAddress)
	//go chunk.LogStats()
	rpc.Register(chunkServ)

	log.Println("chunk: Server Online.")

	l, e := net.Listen("tcp", ":1337")
	if e != nil {
		log.Fatal("chunk error:", e)
	}
	rpc.Accept(l)
	log.Println("chunk: done.")
}
Beispiel #3
0
func main() {

	flag.Parse()
	masterAddress := flag.Arg(0)

	chunkServ := new(chunk.Server)
	if *logging {
		chunk.Init(masterAddress, true)
	} else {
		chunk.Init(masterAddress, false)
	}
	go chunk.SendHeartbeat(masterAddress)

	rpc.Register(chunkServ)

	log.Println("chunk: Server Online.")

	l, e := net.Listen("tcp", ":1337")
	if e != nil {
		log.Fatal("chunk error:", e)
	}
	rpc.Accept(l)
	log.Println("chunk: done.")
}