Flag names need to be unique. This is not a restriction imposed by gRPC. This is the Go stdlib. See: https://pkg.go.dev/flag.
It is not very clear from your description what exactly you are trying to do. Closing and re-establishing a connection, although a valid operation, is not something that you should really need to do. Have you taken a look at gRPC core concepts: https://grpc.io/docs/what-is-grpc/core-concepts/. gRPC does support streaming RPCs. So you could dynamically get new configurations from a server over the same client channel. On Wednesday, September 8, 2021 at 8:44:48 AM UTC-7 arpith...@gmail.com wrote: > I am new to golang and grpc. I am trying to dynamically load some > configurations to an app that I am currently working on. I need to learn if > grpc client connection from my app to another grpc server connection in an > upstream component can be closed and re established based the interrupt > value(listening to a channel). I tried this, and I see panic, that says- > flag redefined: host. In the flag.go file, at panic line, i see // Happens > only if flags are declared with identical names. > > I also tried to exit from the goroutine that established grpc connection > and restart the goroutine. I see the same error. > > Please let me know if closing connection and re establishing is a valid > use case without having to restart the app. > Many thanks! > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/cf4e315f-3fc2-45de-be88-a3dacc400b95n%40googlegroups.com.