diff --git a/rpc/grpc/conn.go b/rpc/grpc/conn.go new file mode 100644 index 00000000..40968b98 --- /dev/null +++ b/rpc/grpc/conn.go @@ -0,0 +1,19 @@ +package grpc + +import ( + "io" +) + +// Conn returns underlying connection. +// +// Conn is NPE-safe: returns nil if Client is nil. +// +// Client should not be used after Close() call +// on the connection: behavior is undefined. +func (c *Client) Conn() io.Closer { + if c != nil { + return c.con + } + + return nil +}