mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 06:51:38 +00:00
@@ -9,8 +9,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
flatbuffers "github.com/google/flatbuffers/go"
|
flatbuffers "github.com/google/flatbuffers/go"
|
||||||
models "github.com/google/flatbuffers/grpc/examples/go/greeter/models"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
|
|
||||||
|
models "github.com/google/flatbuffers/grpc/examples/go/greeter/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -63,7 +65,9 @@ func printSayManyHello(client models.GreeterClient, name string) {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
conn, err := grpc.Dial(fmt.Sprintf("localhost:%d", 3000), grpc.WithInsecure(), grpc.WithCodec(flatbuffers.FlatbuffersCodec{}))
|
conn, err := grpc.Dial(fmt.Sprintf("localhost:%d", 3000),
|
||||||
|
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||||
|
grpc.WithDefaultCallOptions(grpc.ForceCodec(flatbuffers.FlatbuffersCodec{})))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("fail to dial: %v", err)
|
log.Fatalf("fail to dial: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user