实现方案:发送 RST_STREAM 帧 : wrote RST_STREAM stream=9 len=4 ErrCode=CANCEL example: ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() req := &pb.EchoRequest{Message: message} _, err := c.UnaryEcho(ctx, req)