Implements a bi-directional streaming RPC using Golang.
$ go install google.golang.org/protobuf/cmd/[email protected]
$ go install google.golang.org/grpc/cmd/[email protected]
$ export PATH="$PATH:$(go env GOPATH)/bin"
$ protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
--go-grpc_opt=require_unimplemented_servers=false \
greetpb/greet.proto
$ go run server/server.go
$ go run client/client.go
Output:
Starting client streaming...
Sending req: greeting:{first_name:"John" last_name:"Days"}
Received: Hello John
Sending req: greeting:{first_name:"Bob" last_name:"Bar"}
Received: Hello Bob
Sending req: greeting:{first_name:"Alice" last_name:"Ger"}
Received: Hello Alice