You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observed when calling against a service built on the C++ gRPC core.
// Service snippet
classGreeterServiceImplfinal : public Greeter::Service {
Status SayHello(ServerContext* context, const HelloRequest* request,
HelloReply* reply) override {
returnStatus(grpc::StatusCode::NOT_FOUND);
}
};
// Client snippet
package main
import (
"log""os"
pb "github.com/grpc/grpc-common/go/helloworld""golang.org/x/net/context""google.golang.org/grpc"
)
const (
address="localhost:50051"defaultName="world"
)
funcmain() {
// Set up a connection to the server.conn, err:=grpc.Dial(address)
iferr!=nil {
log.Fatalf("did not connect: %v", err)
}
deferconn.Close()
c:=pb.NewGreeterClient(conn)
// Contact the server and print out its response.name:=defaultNameiflen(os.Args) >1 {
name=os.Args[1]
}
r, err:=c.SayHello(context.Background(), &pb.HelloRequest{Name: name})
iferr!=nil {
log.Fatalf("could not greet: %v", err)
}
log.Printf("Greeting: %s", r.Message)
}
Observed when calling against a service built on the C++ gRPC core.
// Service snippet
// Client snippet
Client output:
The text was updated successfully, but these errors were encountered: