예제 #1
0
func initMaster(storage, server, myhostport string) bool {
	mn = masternode.NewMaster(5001, storage)
	if mn == nil {
		fmt.Println("Could not start master node/app logic")
		return false
	}
	return true
}
예제 #2
0
func testNonexistantRssStore() {
	if master := masternode.NewMaster(5001, "localhost:5002"); master == nil {
		fmt.Println("PASS")
		passCount++
	} else {
		fmt.Println("FAIL")
		failCount++
	}
	cleanupMaster(nil)
}
예제 #3
0
파일: systest.go 프로젝트: tnebel/dist_rss
func initMaster(storage, server, myhostport string) net.Listener {
	l := initRssStore(storage, 5002, 1, 0)
	if l == nil {
		return nil
	}
	mn = masternode.NewMaster(5001, storage)
	if mn == nil {
		fmt.Println("Could not start master node/app logic")
		return nil
	}
	return l
}
예제 #4
0
// Core Routine
func main() {
	// Parse command-line flags
	var port int
	var rssServer string
	flag.IntVar(&port, "p", 5001, "Listening Port")
	flag.StringVar(&rssServer, "s", "localhost:5002", "Storage server to get list from")
	flag.Parse()

	mn := masternode.NewMaster(port, rssServer)

	// Begin servicing RPC requests
	rpc.Register(masternoderpc.NewMasterNodeRPC(mn))
	rpc.HandleHTTP()
	l, e := net.Listen("tcp", fmt.Sprintf(":%d", port))
	if e != nil {
		fmt.Printf("Fatal Listen Error:%v\n", e)
		return
	}
	http.Serve(l, nil)
}