func StartServer(info ServerInfo, opts ...grpc.ServerOption) func() {
	opts = append(opts, grpc.WriteBufferSize(128*1024))
	opts = append(opts, grpc.ReadBufferSize(128*1024))
	s := grpc.NewServer(opts...)
	switch info.Type {
	case "protobuf":
		testpb.RegisterBenchmarkServiceServer(s, &testServer{})
	case "bytebuf":
		respSize, ok := info.Metadata.(int32)
		if !ok {
			grpclog.Fatalf("failed to StartServer, invalid metadata: %v, for Type: %v", info.Metadata, info.Type)
		}
		testpb.RegisterBenchmarkServiceServer(s, &byteBufServer{respSize: respSize})
	default:
		grpclog.Fatalf("failed to StartServer, unknown Type: %v", info.Type)
	}
	go s.Serve(info.Listener)
	return func() {
		s.Stop()
	}
}
// StartServer starts a gRPC server serving a benchmark service according to info.
// It returns a function to stop the server.
StartServer starts a gRPC server serving a benchmark service according to info.
It returns a function to stop the server.
// StartServer starts a gRPC server serving a benchmark service according to info . // It returns a function to stop the server .
func StartServer(info ServerInfo, opts ...grpc.ServerOption) func() {
	opts = append(opts, grpc.WriteBufferSize(128*1024))
	opts = append(opts, grpc.ReadBufferSize(128*1024))
	s := grpc.NewServer(opts...)
	switch info.Type {
	case "protobuf":
		testpb.RegisterBenchmarkServiceServer(s, &testServer{})
	case "bytebuf":
		respSize, ok := info.Metadata.(int32)
		if !ok {
			grpclog.Fatalf("failed to StartServer, invalid metadata: %v, for Type: %v", info.Metadata, info.Type)
		}
		testpb.RegisterBenchmarkServiceServer(s, &byteBufServer{respSize: respSize})
	default:
		grpclog.Fatalf("failed to StartServer, unknown Type: %v", info.Type)
	}
	go s.Serve(info.Listener)
	return func() {
		s.Stop()
	}
}
func StartServer ( info ServerInfo , opts ... grpc . ServerOption ) func ( ) { opts = append ( opts , grpc . WriteBufferSize ( 128 * 1024 ) ) opts = append ( opts , grpc . ReadBufferSize ( 128 * 1024 ) ) s := grpc . NewServer ( opts ... ) switch info . Type { case " " : testpb . RegisterBenchmarkServiceServer ( s , & testServer { } ) case " " : respSize , ok := info . Metadata . ( int32 ) if ! ok { grpclog . Fatalf ( " " , info . Metadata , info . Type ) } testpb . RegisterBenchmarkServiceServer ( s , & byteBufServer { respSize : respSize } ) default : grpclog . Fatalf ( " " , info . Type ) } go s . Serve ( info . Listener ) return func ( ) { s . Stop ( ) } }
StartServer starts a gRPC server serving a benchmark service according to info.
StartServer starts a gRPC server serving a benchmark service according to info .