Example #1
0
func initTribServer(masterServerHostPort string, tribServerPort int) error {
	//	l, err := net.Listen("tcp", tribServerHostPort)
	//	if err != nil {
	//		LOGE.Println("Failed to listen:", err)
	//		return nil, err
	//	}

	tribServerHostPort := net.JoinHostPort("localhost", strconv.Itoa(tribServerPort))
	proxyCounter, err := proxycounter.NewProxyCounter(masterServerHostPort, tribServerHostPort)
	if err != nil {
		LOGE.Println("Failed to setup test:", err)
		return err
	}
	pc = proxyCounter

	rpc.RegisterName("StorageServer", storagerpc.Wrap(pc))
	//rpc.HandleHTTP()
	//go http.Serve(l, nil)

	// Create and start the TribServer.
	tribServer, err := tribserver.NewTribServer(masterServerHostPort, tribServerPort)
	if err != nil {
		LOGE.Println("Failed to create TribServer:", err)
		return err
	}
	ts = tribServer
	//rpc.RegisterName("TribServer", tribrpc.Wrap(ts))
	return nil
}
Example #2
0
func main() {
	flag.Parse()
	if flag.NArg() < 1 {
		log.Fatalln("Usage: trunner <master storage server host:port>")
	}

	// Create and start the TribServer.
	_, err := tribserver.NewTribServer(flag.Arg(0), *port)
	if err != nil {
		log.Fatalln("Server could not be created:", err)
	}

	// Run the Tribbler server forever.
	select {}
}
Example #3
0
func main() {
	flag.Parse()
	if flag.NArg() < 1 {
		log.Fatalln("Usage: trunner <master storage server host:port>")
	}

	// Create and start the TribServer.
	hostPort := net.JoinHostPort("localhost", strconv.Itoa(*port))
	_, err := tribserver.NewTribServer(flag.Arg(0), hostPort)
	if err != nil {
		log.Fatalln("Server could not be created:", err)
	}

	// Run the Tribbler server forever.
	select {}
}
Example #4
0
func initTribServer(masterServerHostPort string, tribServerPort int) error {
	tribServerHostPort := net.JoinHostPort("localhost", strconv.Itoa(tribServerPort))
	proxyCounter, err := proxycounter.NewProxyCounter(masterServerHostPort, tribServerHostPort)
	if err != nil {
		LOGE.Println("Failed to setup test:", err)
		return err
	}
	pc = proxyCounter
	rpc.RegisterName("StorageServer", storagerpc.Wrap(pc))

	// Create and start the TribServer.
	tribServer, err := tribserver.NewTribServer(masterServerHostPort, tribServerHostPort)
	if err != nil {
		LOGE.Println("Failed to create TribServer:", err)
		return err
	}
	ts = tribServer
	return nil
}