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
Please answer these questions before submitting your issue.
What version of gRPC are you using?
grpc-go
What version of Go are you using (go version)?
1.10
What operating system (Linux, Windows, …) and version?
ubuntu
What did you do?
In the grpc-go/examples/helloworld/helloworld/helloworld.pb.go,It define a
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type GreeterClient interface {
// Sends a greeting
SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}
type greeterClient struct {
cc *grpc.ClientConn
}
How should I close a GreenClient connect? its not a net.Conn and greeterClient doesn't expose a Close().
The text was updated successfully, but these errors were encountered:
GreeterClient is the stub(interface) for RPC calls. greeterClient is the proto generated implementation of GreeterClient interface, and greeterClient takes a ClientConn to be initialized (here). Therefore, to close the connection, you simply close the ClientConn you initialize greeterClient with (like here). greeterClient itself is not a connection, therefore cannot be closed. It only keeps a reference to a connection(i.e. ClientConn). Thanks!
Please answer these questions before submitting your issue.
What version of gRPC are you using?
grpc-go
What version of Go are you using (
go version
)?1.10
What operating system (Linux, Windows, …) and version?
ubuntu
What did you do?
In the
grpc-go/examples/helloworld/helloworld/helloworld.pb.go
,It define aHow should I close a GreenClient connect? its not a net.Conn and greeterClient doesn't expose a Close().
The text was updated successfully, but these errors were encountered: