Closes the gRPC connection
()
| 149 | |
| 150 | // Closes the gRPC connection |
| 151 | func (i *invoker) Close() error { |
| 152 | i.cancelPF() |
| 153 | |
| 154 | // Closing the local listener effectively closes the gRPC connection |
| 155 | if err := i.listener.Close(); err != nil { |
| 156 | i.conn.Close() // If we fail to close the listener, explicitly close the gRPC connection and ignore any error |
| 157 | return fmt.Errorf("failed to close local tcp port listener: %w", err) |
| 158 | } |
| 159 | |
| 160 | return nil |
| 161 | } |
| 162 | |
| 163 | // Appends the authentication token to the gRPC context |
| 164 | func (i *invoker) appendMetadata(ctx context.Context) context.Context { |